Solved

Open Browser Window

Posted on 2004-08-15
3
358 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
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

This article will give core knowledge of JavaScript and will head in to your first JavaScript program. I am Durvesh Naik and I am here to deal with this series of JavaScript. I will teach you JavaScript in part wise , as its quite boring to read big…
This article discusses the difference between strict equality operator and equality operator in JavaScript. The Need: Because JavaScript performs an implicit type conversion when performing comparisons, we have to take this into account when wri…
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…

914 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

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now