JavaScript Tutorial Part I - Introduction - This is the first part of several in JavaScript branch. It covers just as the title says, "Introduction". Primarily for readers who are just starting to get a bit involved in JavaScripting. Next part will be coming by next week. Oh, and remember, "It all starts with a good foundation".
JavaScript Tutorial Part II - The Language - This is the second tutorial in three part JavaScript Tutorial series. It'll cover the language structure, the main body of JavaScript, the meat of the meal. Well, you kinda get the point by now.
JavaScript Tutorial Part III - Common Scripts - This is the third and last tutorial in three part JavaScript Tutorial series. It covers the basic script structure as well as give examples of many widely used scripts. The readers have by now already grasp the basics of the JavaScript but this is the chery on the top.
TW Tech Glossary - Misplaced your bible? Well here it is! This truly took a while to complete and should be used by all from beginners to advance techies. Look into it, you won't be sorry. (Very Resourceful)
JSP & JAVA Servlets - JSPs have dynamic scripting capability that works in tandem with HTML code, separating the page logic from the static elements ...
Best of the Web Hosting Show Guides - When moving from house to house, you have to pack up all of your belongings in the old house before you can move, right? The same could be said when you are moving from web host to web host. The first and most important thing you can do is backup your web site and get it ready for the move. Remember to grab all of your static files. This would be all of your non-dynamic pages, images, templates and more. The exact files that you do backup might change depending on how your site is setup.
What is JavaScript?
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.
JavaScript can interact with HTML source code, enabling Web authors to spice up their sites with dynamic content. JavaScript is endorsed by a number of software companies
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.
Tips
HEAD or BODY -- Where To Put JavaScript Code
Ifit will work that way, put the JavaScript code in the HEAD section of your page.Although not all JavaScript is required to be there, code in the HEAD section isloaded and ready before the web page completes loading.
Ingeneral, if the JavaScript must be available to the page on or before itcompletes loading, it must be in the HEAD area. Otherwise, it may be in the BODYarea at or above the point where it will be utilized.
Converta JavaScript Variable to Upper Case
Thefollowing example shows you how to convert a variable in JavaScript touppercase. When performing If string comparisons you should always convert thestring variable to upper or lower case and then compare it to all upper or lowercase literals or variables. This will eliminate a lot of run-time programanomalies
<scriptlanguage="JavaScript">
var x = "Bill";
x = x.toUpperCase() // Use toLowerCase() for lower case conversion
alert(x)
</script>
Displayinga message in a pop-up window
JavaScripthas a function called alert()which pops up a window with the message you pass to alert() as parameter. The simplest example of usingthis function is to display a message when your page loads. To do this just putthe following code right after the <BODY>tag (or within the <HEAD>tag or where ever you want).
<SCRIPTLANGUAGE="JavaScript">
<!-- Hide from older browsers
alert("Press Ok to start formatting your hard disk");
// end hiding -->
</SCRIPT>
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.
Examplelink:
<ahref="view-source:http://willmaster.com/">
Viewsource of willmaster.com home page</a>
Examplebutton:
<form>
<input type="button" value="Viewsource of willmaster.com home page"
onClick="location.href='view-source:http://willmaster.com/'">
</form>
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.
<SCRIPTLANGUAGE="JavaScript">
<!--//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 -->
</SCRIPT>
ResizingYou Current Browser Window
Usethis trick to resize the window size of your current browser. You can associatethis JavaScript function call with any HTML Object event.
<bodyonload="javascript:window.resizeTo(300,300)">
"Printthis Page" Link or Button
Whenyou want to remind people to print a page, you can make it easy for them with alink. The code presented here works with most JavaScript enabled browsers andwill produce a link that functions like the browser's "print" button.
Asimple text link (can also serve as an image link):
<ahref="javascript:print()">Print this page!</a>
Aform button with the same function:
<form>
<inputtype="button"
value="Printthis page!"
onClick="javascript:print()">
</form>
Howto Redirect a URL to another Frame using JavaScript
Thiscode can be used to redirect the current web page to a URL of a different frameon the current page.
<scriptlanguage="JavaScript">
parent.frame2.location.href="http://www.katungroup.com"
</script>
Creating a scrolling textbox
Byusing small pieces of JavaScript you can create a scrolling text in a text box.First we need to insert the scrolling text JavaScript code in the HEAD of the page.
Thenwe need to set the text box scrolling once the page has loaded. This is done bycalling the JavaScript function by using the onLoadevent handler in the BODYelement. Note you can also include any other of the normal BODY attributes, such as BGCOLOR, alongside the onLoad event handler.
BODYonLoad="banner()">
Andfinally we need to actually insert the text box into the page.
<FORMNAME="thisform">
<INPUT TYPE="text" NAME="thisbanner"size="40">
</FORM>





