Skip to main content

Posts

JAVASCRIPT BASICS

JavaScript has programming capabilities similar to the most programming languages such as variables, data types, constants, programming constructs, user defined functions etc.. Characteristics of JavaScript 1. JavaScript is Case Sensitive: Unlike HTML, JavaScript is case sensitive. You need to take care when you write javaScript statements, create or call variables, objects and functions. 2. JavaScript Statements: JavaScript is a sequence of statements that are to be executed by the browser. It is a command to the browser which tells browser what to needs to do. The following JavaScript statement tell the browser to write "Hello" on the web page: document.write("Hello"); 3. You need to add a semicolon at the end of each executable statement. According to the JavaScript standard semicolon is optional and the browser is supposed to interpret the end of the line as the end of the statement. Using semicolons makes it possible to write multiple stateme

Browser support to JavaScript

Browser support to JavaScript It is possible that a browser do not support JavaScript (generally older versions of the browsers). In such cases JavaScript will be displayed as the content of the webpage as explained above. To prevent them from doing this and as a part of the JavaScript standard you should use the HTML comment tag to "hide" the JavaScript. For this you need to add an HTML comment tag (end of comment) after the last JavaScript statement. E.g. Note: In the above example the two forward slashes at the end of comment line (//) are the JavaScript comment symbol. This prevents JavaScript from executing the --> tag. In case browser does not support JavaScript, the JavaScript code will not be displayed in the webpage as it is written inside the HTML comment tag. Using JavaScript and HTML together As you have seen that you can easily embedded JavaScript in a HTML document. Whenever you need to write JavaScript code you need to use In the

UNDERSTANDING JAVA SCRIPT

Advantage of Using JavaScript 1. Embedded with in HTML: JavaScript is embedded with in a HTML. It does not require any separate editor for programs to be written /edited/compiled. Like HTML JavaScript can be written in simple editor such as HTML. 2. Improved Performance: JavaScript is written with the HTML tags and is interpreted by the browser. This minimizes storage requirement on the web server and download time for the client. 3. Minimal Syntax: The rules for the syntax are simple and applications can be quickly built. 4. Designed for Simple Programs: Simple small programs can be easily written and implemented using JavaScript. Such programs can be easily integrated in a webpage. 5. An Interpreted Language: JavaScript is an interpreted language. It does not require a compilation steps. The syntax is interpreted by the browser just as it interprets HTML tags. 6. Good Programming Constructs: Lik

INTRODUCTION TO JAVA SCRIPT

With the popularity of web there is a need to allow users to interact with the website. Websites need to be intelligent enough to accept user’s request/feedback and dynamically change the content of the webpage on the basis of user input. Some changes like changing background when the content get changed or showing content on the basis of input entered by the user helps to attract the users. JavaScript has been developed to improve the design, validate form entries, detect browsers and manipulate their object, create cookies, and much more. It has emerged as one of the popular scripting language on the internet. JavaScript can be understood as a scripting language that adds interactivity to HTML pages. It is embedded directly into HTML pages and is an interpreted language i.e. you can execute a JavaScript without preliminary compilation. In this blog you will learn about using JavaScript with HTML. After completing this tutorial you will be able to: 1. Write simple pr