|
JavaScript Home
JavaScript Tutorial Home Basic JavaScriptIntroductionHow to Enable JavaScript JavaScript Syntax External JavaScript File JavaScript Operators JavaScript Variables JavaScript Functions JavaScript Events JavaScript If Statements JavaScript Switch Statements JavaScript While Loop JavaScript For Loop JavaScript Try Catch JavaScript Escape Characters JavaScript Void(0) Advanced JavaScriptJavaScript CookiesJavaScript Date and Time JavaScript Arrays Two Dimensional Arrays JavaScript Summary JavaScript ReferenceJavaScript Reserved WordsJavaScript Event Handlers JavaScript Date and Time Functions JavaScript Code LibraryJavaScript Dropdown MenuJavaScript Print JavaScript Alert Box JavaScript Status Bar Messages Image Rollovers Popup Windows JavaScript Redirect Timed JavaScript Redirect JavaScript Refresh Page Timed JavaScript Redirect Got a MySpace Page?Get "www.yourname.com" for your MySpace page. Learn how >>. |
JavaScript Popup WindowsYou can use JavaScript to create popup windows. Popup windows are different to simply opening a new browser window. If you only want to open a new browser window you can add the Create a JavaScript popup window
The Create a Popup Window FunctionYou can put the above code into a function, then call the function, passing the URL as a parameter, whenever you want to open a popup window. Basic JavaScript popup window function
The above code creates a function that accepts a parameter called "url". You can now call the function in your HTML as follows. Call your popup window function<a href="JavaScript:newWindow('http://www.quackit.com/common/link_builder.cfm')">
Open a popup window
</a>
ExampleThe above function should work like this: Important note: I have used line breaks in the above examples to improve readability. Your JavaScript arguments should not have line breaks, they should be a continuous string. Enjoy this website?
Oh, and thank you for supporting Quackit! |
FREE Hosting!With every domain name you register with ZappyHost, you get FREE (ad supported) hosting.PLUS you get:
Featured Template:
(Build your websites in minutes!) |