Javascript introduction tutorial / Basics of Javascript
Javascript is a client side program, it will handle by the browser. JavaScript is an object oriented programming language that is used in web pages to create interactive contents in web pages. JavaScript is a dynamic language and is a part of web browser.
Some Javascript Frameworks
- Jamal
- Sproutcore
- JavaScriptMVC
- Asana Luna
- Backbone.js
- qooxdoo
- Spine
- ActiveJS
- Eyeballs
Uses of JavaScript
JavaScript is used in webpages in web pages for validation to interactive content display. JavaScript is implemented on web browser and provide users with enhanced user interfaces and dynamic websites. JavaScript reduces the burden of user and the server by performing actions on your data before sending to the server(e.g:consider you are filling an online form full of dates and you willed it in the order day/month/year but the server needs in the form year/month/day. This is where JavaScript comes in it validates the data before sending the data to server and corrects you by saving both you and the serve.it can also use to create animation in pages and many more stuff…
How it works
Unlike other languages JavaScript does not have a compiler to process its language but it has an interpretor.This is built inside the browser. The interpreter varies largely with the browser. This interpreter is a JavaScript engine.it supports in built objects as well as allows creation and deletion of their objects.v8 JavaScript engine is used in projects like Google chrome.it is of two types’ server side and client side.
Write Javascript Code
Mainly three way of adding javascript code to HTML page, they are
- Inline JavaScript
- Internal JavaScript
- External JavaScript
Method I (Inline JavaScript)
In this method the JavaScript code are write directly inside of the HTML tags.
Example
<input type="button" value="Click Me" onclick="window.alert("Im Alert Box");">
Method II (Internal Javascript)
In this method JavaScript code are wite inside the <script> and </script> tag.
Example
------
------
<script>
function test()
{
alert("The button was Clicked");
}
</script>
------
------
<input type="button" value="Call Function" onclick="test();">
------
------
Method III (External JavaScript)
Write the javascript code to another file (.js) and integrate with the program like below
<script type="text/javascript" src="filename.js"> </script>
Post a Comment for "Javascript introduction tutorial / Basics of Javascript"