Solved

Open Browser Window

Posted on 2004-08-15
3
362 Views
Last Modified: 2006-11-17
I want to have a simple little pop up type window open when I click on a peice of text. I am using this function:

function MM_openBrWindow(myURL,winName,features) {
      window.open(myURL,winName,features);
}

And calling it this way:
            <a href="ProductWindows/Moped.htm"onMouseDown="MM_openBrWindow('ProductWindows/Moped.htm','Mighty Aphrodite','scrollbars=yes,resizable=yes,width=500,height=400')">Moped</a>

But I keep getting the debug error that I have an incorrect argument in the function itself. It's been a while since I used this and I had no problems before that I can remember.
Any ideas? Or better ways of doing this?
Thanks
0
Comment
Question by:SmartGirl
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 13

Accepted Solution

by:
StormyWaters earned 125 total points
ID: 11806111
I can't tell because of a line break, but you can't have spaces in the window name.
Secondly, why is there a href if it's opened in a new window?
Thirdly, why are you using onMouseDown? It should be onClick.

So:

<a href="#" onClick="MM_openBrWindow('ProductWindows/Moped.htm', MightyAphrodite', 'scrollbars=yes,resizable=yes,width=500,height=400')"Moped</a>
0
 
LVL 3

Assisted Solution

by:pulupul
pulupul earned 125 total points
ID: 11806118
And, IMHO, better:

<a href="javascript:MM_openBrWindow('ProductWindows/Moped.htm',MightyAphrodite', 'scrollbars=yes,resizable=yes,width=500,height=400')">Moped</a>
0
 

Author Comment

by:SmartGirl
ID: 11806126
Thanks,
I actually found this that works fine:
function popUp(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=1,width=500,height=300,left = 262,top = 134');");
}
0

Featured Post

The Ultimate Checklist to Optimize Your Website

Websites are getting bigger and complicated by the day. Video, images, custom fonts are all great for showcasing your product/service. But the price to pay in terms of reduced page load times and ultimately, decreased sales, can lead to some difficult decisions about what to cut.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article discusses how to create an extensible mechanism for linked drop downs.
Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

688 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question