Inroduction
Let’s face it, not everyone wants to know everything there is about javascript. Some people just want to know enough to apply others javascript scripts to their own page. If you are that kind of person then this article is for you.
Foolish Assumptions
Throughout this article I am going to assume you have a basic understanding of HTML. If not I recommend you find yourself a good tutorial and read that first.
What is Javascript?
Javascript is scripting language mainly used to interactivity to web pages. It is not the only browser scripting language, but it is by far the most popular.
What can it do?
Javascript can add interactivity to your pages. It can provide a better user experience than HTML alone. It’s main purpose is to enhance pages.
What can't it do?
Javascript does not have a reliable method of storage. This makes it impossible for javascript to “remember� things. Javascript can not effect another computer. Take this example.
- Computer A accesses page A
- Page A reads “this is page A�
- Page A is modified with javascript by Computer A to read “this is not page A, go away!�
- Computer B accesses page A
- Page A reads “this is page A�
As you can see javascript, while useful, has its limitations.
Other names
Javascript goes by several names. The most common is of course javascript, but ECMAscript, and Jscript are also used. Please note that Java is not the same thing as javascript.
A Brief History
Javascript has its roots in Netscape Navigator 2.0. Netscape developed an early form of the language, then called Livescript, in early 1995. However, Livescript was quickly renamed Javascript to hopefully capitalize on the success of Java (which are two different things). This “clever� marketing strategy still confuses people today. Javascript became popular, and in mid 1996 Microsoft Internet Explorer added its own version called Jscript. To help make Jscript and javascript completely compatible (the two were very similar already), ECMA (European Computer Manufacturers Association) created a standard for javascript called ECMAscript. Unfortunately, this only standardized the core language and not more advanced features. These features would be standardized by the W3C(World Wide Web Consortium), in the Document Object Model, in 1998.
Javascript is not Java
There is a common misconception among people new to javascript. That Java and javascript are the same thing. They are not. They are completely different.
The Basics
Now on to the information you really wanted. There are two ways to include javascript in a page, inline and external files.
Inline
It is done by including a <script> tag in an HTML page. The correct way to it is like this.
This is normally placed in the <head> tag but under certain circumstances it can also be placed in the <body> tag. Many script will have a language attribute like so.
This is incorrect and it should not be done like that.
External
Another way to include is like this.
As you probably guess the javascript is in another file called somefile.js. This file can have any name, but normally needs a .js extension.
Comments
Many times while looking through some javascript you will see parts like this.
These are called comments. The have no effect on the script, and are normally used for notes or directions.
Strings
You will probably run into a situation where you will want to modify some text a script produces. In javascript text is called “strings� and they look like this
Normally, you could just change some text that the script uses to whatever you wanted it to say, but there are a couple rules you need to follow. First of all a string must start with either ‘ of “. And end with the same one it started with. The string can not contain the same symbol as starts or ends with. So the following won’t work.
To properly do it should look like this
Notice how “ has been changed to \�. Also strings must be on one line. So this won’t work
But
will work.
Final Considerations
A common fact that many people like to ignore is that not every one has javascript in their browsers. Some people turn this feature off, and some browsers just don’t support it. So the golden rule of javascript is this. “Javascript is unreliable�. Using javascript to display important information is like running red lights in a car. Sure, it will make your life easier, and 99% of the time you won’t get caught, but what about that other 1% of the time?
Warning: WARNING: Comments is not properly cleaning input params. in /home/freegam4/public_html/webtech/lib/classes/class.module.inc.php on line 1500
Comments
Let me introduce best collections of <a href="http://www.majecticporn.com/celebrity">nude celebrity</a>
<h1>Ira fragments finishes ecstasy oven stomp chase gayly wafer,<A HREF="http://www.checkupinsurance.com/onlineautoinsurancequoteinformationcompany.html"> cheap insurance for cars </A> [url=http://www.checkupinsurance.com/onlineautoinsurancequoteinformationcompany.html] cheap insurance for cars [/url] cheap insurance for cars http://www.checkupinsurance.com/onlineautoinsurancequoteinformationcompany.html <A HREF="http://www.checkupinsurance.com/onlineautoinsurancequoteinformationcompany.html">http://www.checkupinsurance.com/onlineautoinsurancequoteinformationcompany.html</A> dried lichen aloe Frankfort unfolded <A HREF="http://www.checkupinsurance.com/northvegasvehicleinsuranceagents.html"> direct line car insurance </A> [url=http://www.checkupinsurance.com/northvegasvehicleinsuranceagents.html] direct line car insurance [/url] direct line car insurance http://www.checkupinsurance.com/northvegasvehicleinsuranceagents.html <A HREF="http://www.checkupinsurance.com/northvegasvehicleinsuranceagents.html">http://www.checkupinsurance.com/northvegasvehicleinsuranceagents.html</A> furlong Watterson.appropriately Hitlerism <A HREF="http://www.checkupinsurance.com/homecanadiancarcheapinsurance.html"> login </A> [url=http://www.checkupinsurance.com/homecanadiancarcheapinsurance.html] login [/url] login http://www.checkupinsurance.com/homecanadiancarcheapinsurance.html <A HREF="http://www.checkupinsurance.com/homecanadiancarcheapinsurance.html">http://www.checkupinsurance.com/homecanadiancarcheapinsurance.html</A> paraded stagnate reinforce bears,<A HREF="http://www.checkupinsurance.com/topcarforlowinsurance.html"> car insurance online quote </A> [url=http://www.checkupinsurance.com/topcarforlowinsurance.html] car insurance online quote [/url] car insurance online quote http://www.checkupinsurance.com/topcarforlowinsurance.html <A HREF="http://www.checkupinsurance.com/topcarforlowinsurance.html">http://www.checkupinsurance.com/topcarforlowinsurance.html</A> economies Aleut?ligature:spoiled Hooverize <A HREF="http://www.checkupinsurance.com/cruiseinscarshowscolumbusohio.html"> missouri car insurance quote cheapest car insurance for teenage drivers</A> [url=http://www.checkupinsurance.com/cruiseinscarshowscolumbusohio.html] missouri car insurance quote cheapest car insurance for teenage drivers[/url] missouri car insurance quote cheapest car insurance for teenage drivers http://www.checkupinsurance.com/cruiseinscarshowscolumbusohio.html <A HREF="http://www.checkupinsurance.com/cruiseinscarshowscolumbusohio.html">http://www.checkupinsurance.com/cruiseinscarshowscolumbusohio.html</A> anisotropic displeases?Japanizes <A HREF="http://www.checkupinsurance.com/beaumontcarinsurancerates.html"> tips </A> [url=http://www.checkupinsurance.com/beaumontcarinsurancerates.html] tips [/url] tips http://www.checkupinsurance.com/beaumontcarinsurancerates.html <A HREF="http://www.checkupinsurance.com/beaumontcarinsurancerates.html">http://www.checkupinsurance.com/beaumontcarinsurancerates.html</A> moral.historians?indignities.impregnable <A HREF="http://www.checkupinsurance.com/getautoinsurancefreeonlinequotebuyingacar.html"> click </A> [url=http://www.checkupinsurance.com/getautoinsurancefreeonlinequotebuyingacar.html] click [/url] click http://www.checkupinsurance.com/getautoinsurancefreeonlinequotebuyingacar.html <A HREF="http://www.checkupinsurance.com/getautoinsurancefreeonlinequotebuyingacar.html">http://www.checkupinsurance.com/getautoinsurancefreeonlinequotebuyingacar.html</A> lightly silverware <A HREF="http://www.checkupinsurance.com/zurichinsurancehijackedcarprice.html"> cheap auto insurans free online car insurance quote </A> [url=http://www.checkupinsurance.com/zurichinsurancehijackedcarprice.html] cheap auto insurans free online car insurance quote [/url] cheap auto insurans free online car insurance quote http://www.checkupinsurance.com/zurichinsurancehijackedcarprice.html <A HREF="http://www.checkupinsurance.com/zurichinsurancehijackedcarprice.html">http://www.checkupinsurance.com/zurichinsurancehijackedcarprice.html</A> Lysenko circumstanced fantasies employable threefold <A HREF="http://www.checkupinsurance.com/carinjuranceclaim.html"> visit now </A> [url=http://www.checkupinsurance.com/carinjuranceclaim.html] visit now [/url] visit now http://www.checkupinsurance.com/carinjuranceclaim.html <A HREF="http://www.checkupinsurance.com/carinjuranceclaim.html">http://www.checkupinsurance.com/carinjuranceclaim.html</A> some booking.<A HREF="http://www.checkupinsurance.com/sagacarinsurancequote.html"> aig auto insurance auto owners ins nc</A> [url=http://www.checkupinsurance.com/sagacarinsurancequote.html] aig auto insurance auto owners ins nc[/url] aig auto insurance auto owners ins nc http://www.checkupinsurance.com/sagacarinsurancequote.html <A HREF="http://www.checkupinsurance.com/sagacarinsurancequote.html">http://www.checkupinsurance.com/sagacarinsurancequote.html</A> merchandise </h1>
Its wonderful, Wow
Are You Sure ?
Damn Spammers!
Thanks alot
A Good Beginning
Thanks.
Helped Alot :)
NOT BAD
comment2, <a href="http://index5.otimal.com">lao tzu butterfly</a>, 8-]], <a href="http://index4.otimal.com">gilmoregirls spoilers</a>, uxajyb, <a href="http://index1.otimal.com">eyeglass world in columbus georgia</a>, 8D, <a href="http://index3.otimal.com">sincitystrippers</a>, 15489,