SitePoint Sponsor |
|
User Tag List
Results 1 to 10 of 10
Thread: Modifying a JavaScript Function
Threaded View
-
Nov 15, 2000, 09:38 #1
- Join Date
- Aug 1999
- Location
- Pittsburgh, PA, USA
- Posts
- 3,910
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Hi,
I'm using some code to generate a pop-up upon the clicking of a link. Here's the code I have in my HEAD tags:
Code:<script language="JavaScript"> <!-- function PopWindow() { window.open('page.html','popup','width=550,height=400,menubar=no,scrollbars=yes,toolbar=no, location=no,directories=no,resizable=yes,top=50,left=50'); } //--> </script>
<a href="JavaScript:PopWindow()">Open Window</a>
I'd like to, if possible, switch things around a bit so the page is not specified in the function, but so I can specify it each time I call the function, something like this:
<a href="JavaScript:PopWindow(page.html)">Open Window</a>
I've tried modifying the code in several different ways, but an error always follows. Any help would be greatly appreciated.
Bookmarks