What is JavaScript? JavaScript is a scripting language that enables web developers/designers to build more functional and interactive websites. Common uses of JavaScript include: Alert messages Popup windows Popup windows Dynamic drop down menus Form validation Displaying date/time JavaScript usually runs on the client-side(the browser's side), as opposed to server-side(on the web server). One benefit of doing this is performance. On the client side, JavaScript is loaded into the browser and can run as soon as it is called. *---java script book in PDF format--*
Click the following button, you will be redirected to home page. <html> <head> <script type="text/javascript"> <!-- function Redirect() { window.location="http://www.google.com"; } //--> </script> </head> <body> <p>Click the following button, you will be redirected to home page.</p> <form> <input type="button" value="Redirect Me" onclick="Redirect();" /> </form> </body> </html>
auto redirected <html> <head> <script type="text/javascript"> <!-- function Redirect() { window.location="http://www.google.com"; } document.write("You will be redirected to main page in 10 sec."); setTimeout('Redirect()', 10000); //--> </script> </head> <body> </body> </html>
Comments
Post a Comment