Tag Archive | Javascript

JavaScript: Understanding Document Object Model (DOM)

Document Object Model or DOM is a programming interface for the document (HTML, Dynamic HTML or XML) which provide the ability to manipulate the elements (HTML tags and String literal) that makes up a document. In a normal scenario, when server sends the response in the form of an HTML page, browser takes that HTML […]

Javascript: Placing of script tag, does it matter?

We know that to execute any java script statement, we have to include it in tags. But where you put the tag in html page also matters. The placing can change the behavior of html page. Browser will execute the javascript statement at the first occurrence of tag. Let us see that with a short […]

Javascript: Is really javascript client side language?

The general perception is that since javascript is used only in browsers, it is considered to be a client side language. But that’s not true, javascript can be used in other places other than web browsers. Node.js Yes, javascript can be run on the server side with Node.js. In the early days of web development, […]

Javascript: Online JS interpreter for quick check

Sometimes, we are in need to quickly check the working of one or the other api. Online interpreter comes very handy at those times. Recently, I came across a similar utiliy which I am sharing below http://mochi.github.io/mochikit/examples/interpreter/ Snapshot

Javascript: Detect the OS running on client machine

Many times we want information related to what operating system client might be running, depending on it certain actions will be performed. Through javascript this can be achieved very easily. Navigator object in javascript contains all the information about the browser like browser name, engine name, version of the browser etc. Here, is an example […]

Javascript: Working with onLoad event

onLoad() enables us to call a javascript code on the load of object. Example showing the onload with body elemnt. In this case, as soon as the body of the page gets loaded, the javascript function “showAlert()” will get called. This approach is useful when you want something to execute as soon as your page […]

Javascript: Scope of local and global variable

Variables in javascript have two kinds of scope: local and global Global variable: This type of variable can be access anywhere in the document local variable: This has a limited access to the place where it is defined for example inside javascript function Output