What is the difference between Java and JavaScript?

Post Views: 0 Don’t be fooled by the term Java in both. Both are quite different technologies. The key differences can be summarized as follows: JavaScript variables are dynamically typed, whereas the Java variables are statically typed. var myVar1 = “Hello”;         //string type var myVar2 = 5;               //number type var myVar3 = new Object( );   //empty object type var myVar4 = {};              //empty object type — JSON (JavaScript Object Notation) style. In JavaScript properties and methods are dynamically added, whereas…

Read More

What is unobtrusive javascript? How to add behavior to an element using javascript?

Post Views: 2 Unobtrusive Javascript refers to the argument that the purpose of markup is to describe a document’s structure, not its programmatic behavior and that combining the two negatively impacts a site’s maintainability. Inline event handlers are harder to use and maintain, when one needs to set several events on a single element or when one is using event delegation. <input type=”text” name=”date” /> Say an input field with the name “date” had to be validated at runtime: document.getElementsByName(“date”)[0].…

Read More