|Summary of Content|
provides two ways to create line breaks within a string. The
first is the newline character (
\n ). The
newline character creates line breaks within the output of a
Here is a long string without line breaks:
var noBreaks = Hello. My name is Neil. What is your name?
The same string with line breaks:
My name is Neil.
What is your name?
This means that a window called 'mywindow' will open with the page link.html in it, exactly like with the HTML code above.
I will give you more information about how this command works in a later part but for now all you really need to know is the following: In your standard HTML code include a link as follows:
<a href="#" onClick="window.open('link.html','mywindow');">Click Here</a>
As you can see this is just the same window.open command inside an HTML tag.
There are many things you can include here. For example if you wanted a window that only has a location bar and a status bar (the part at the bottom of the browser) then you would use the following code:
The following can be included in the new window command:
This window will open with a location bar, toolbar and will be resizable:
window.open('window1.htm','the_first_window','location, toolbar, resizable');
This will open another page in this window:
This will open a window 200 pixels wide and 300 pixels high. It is not resizable and has a status bar and will scroll if necessary. This is a very commonly used combination:
Extract from Freewebmasterhelp.com
How to add multiple scripts to one page. Many people complain that, while a script works as it
should alone on the page, when a second (or more) one is added, all of a sudden either one or both of the scripts no longer
|Standard Pop Up Windows|
|Here are the three different 'built in' popup windows. Alert, Confirm, and Prompt. Alert is used for letting the user know something. Confirm is used when you want to ask the user a yes or no question. The user will be able to click either 'OK' or 'Cancel', OK will return 'true', and Cancel will return 'false'. The last, Prompt, will let the user fill in a small text field and then click OK to send the value of the text field to the script|
|Hyperlink titles may have been abbreviated, (right click on the link and select properties for the full URL)|
|A double mouse click anywhere on the page will take you back to the top (except when over hyperlinks)|