Solved

Open Browser Window

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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

In my daily work (mainly using ASP.net), I need to write a lot of JavaScript code. One of the most repetitive tasks I do are the jQuery Ajax calls. You know: (CODE) I don't know if for you it's the same, but for me is soooo tedious to write the …
Having worked on larger scale sites, we found out that you are bound to look at more scalable solutions to integrating widgets, code snippets or complete applications and mesh them into functional sites, in any given composition. To share some of…
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…

809 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