Chapter 3 (1)
Chapter 3 (1)
(CoSc3121)
Chapter 3
JavaScript
Example:
<script>
function getgoing (){
window.location = "http://www.bdu.edu.et";
}
alert( "You will be redirected in five seconds.");
setTimeout ('getgoing()', 5000);
</script >
Creating New Browser Window
• To open a new window, we need to call the window.open() method.
• window.open (‘url to open’, ‘window name’, attribute1, attribute2, …);
• Window attributes:
• width = 300
• height = 200
• resizable = yes or no
• scrollbars = yes or no
• toolbars = yes or no
• status = yes or no
• menubar = yes or no
• copyhistory = yes or no
• An example is shown with some of the attributes.
Creating New Browser Window (cont...)
Example:
<FORM>
<INPUT type="button" value="New Window!" onClick="window.open('http://www.bdu.edu.et’,
'mywindow’, 'width=400', 'height=200', 'toolbar=yes', 'status=yes')">
</FORM>
END