<form><input type="button" value="Print This Page" onClick="window.print()" />
</form>--------------------------------------
JavaScript Window.Location<script type="text/javascript">
window.location = "http://www.bbu.edu.kh";</script>
--------------------------------------
JavaScript Time Delay<html><head>
<script type="text/javascript">function delayer()
{window.location = "mypage.html";
}</script>
</head><body onLoad="setTimeout('delayer()', 5000)">
<h2>Prepare to be redirected!</h2></body>
</html>------------------------------------------
JavaScript window.open Function<html>
<head><script type="text/javascript">
<!--function myPopup()
{window.open( "http://www.google.com/" );
}//-->
</script></head>
<body><form>
<input type="button" onClick="myPopup()" value="POP!"></form>
</body></html>
----------------------------------------Upgraded JavaScript Popup Window!
<html><head>
<script type="text/javascript"><!--function myPopup2()
{window.open( "http://www.google.com/", "myWindow", "status = 1, height = 300, width = 300, resizable = 0" )}//--></script>
</head><body>
<form><input type="button" onClick="myPopup2()" value="POP2!">
</form></body>
</html>--------------------------------------
Form Validation - Checking for Non-Empty<script type='text/javascript'>
function notEmpty(elem, helperMsg){ if(elem.value.length == 0)
{ alert(helperMsg);elem.focus();
return false;}
return true;}
</script><form>Required Field:
<input type='text' id='req1'/><input type='button' onclick="notEmpty(document.getElementById('req1'), 'Please Enter a Value')" value='Check Field' /></form>
--------------------done---------------------