A Web scripting language that is used in both browsers and Web servers. It is not a Java technology.
A scripting language developed by Netscape to enable Web authors to design interactive sites. Although it shares many of the features and structures of the full Java language, it was developed independently.
And is an open language that anyone can use without purchasing a license. Recent browsers from Netscape and Microsoft support it, though Internet Explorer supports only a subset, which Microsoft calls Jscript.
var x = "Bill";
x = x.toUpperCase() // Use toLowerCase() for lower case conversion
Displayinga message in a pop-up window
<!-- Hide from older browsers
alert("Press Ok to start formatting your hard disk");
// end hiding -->
Thisis a great way to scare off visitors to your page but let us see if it'spossible to something more useful. What if we want to pop-up a message box whenthe user clicks on a link. It so happens that this is indeed possible.
ViewSource Code Link
Letyour visitors view the source code of any web page, on your own site orelsewhere, by clicking a link or button.
Viewsource of willmaster.com home page</a>
<input type="button" value="Viewsource of willmaster.com home page"
Inboth instances, change the URL to the URL of the web page you are providing thesource code to, and change the prompts to your preferences.
Automatically opening awindow
Whenyour readers enter a page you can automatically open a new, often smaller windowdisplaying another WebPages. This trick is often used to bring up an advertconsole or control panel. You can specify the size and position of the windowand turn off some or all the normal features of a graphical browser: scrollbars,toolbar, location bar, directory buttons, status bar and menu bar. The width andheight are specified in pixels and the position is specified in pixels from thetop-left of the screen. Place the code in between the <HEAD></HEAD> tags of your document.
<!--//hide script from old browsers
window.open("newpage.htm", "new_win", "resizable=yes,scrollbars=no, toolbar=no, location=no, directories=no, status=no, menubar=no,width=520, height=200, top=5, left=5")
//end hiding contents -->
ResizingYou Current Browser Window
"Printthis Page" Link or Button
Asimple text link (can also serve as an image link):
Aform button with the same function:
Thiscode can be used to redirect the current web page to a URL of a different frameon the current page.
Creating a scrolling textbox
Andfinally we need to actually insert the text box into the page.
<INPUT TYPE="text" NAME="thisbanner"size="40">