Tag Archives: JavaScript

How to execute a JS method on any DOM change in the HTML page at runtime

You need to bind a function to the DOMSubtreeModified mutation event: $(document).bind(‘DOMSubtreeModified’, function () { <Code to Execute> }); If your target browsers support it, you should use a¬†MutationObserver¬†instead.

Posted in JavaScript | Tagged , | Leave a comment

How to include a JavaScript file in another JavaScript file

There are two main ways to achieve this: 1 – You can load it with an Ajax call and then use eval. This is the most straightforward way, but it’s limited to your domain because of the JavaScript safety settings, … Continue reading

Posted in CSS, JavaScript | Tagged , , , , | Leave a comment

What’s the difference between display: none and visibility: hidden?

Question: What’s the difference between display: none and visibility: hidden?The display: none and visibility: hidden CSS properties appear to be the same thing, but they aren’t. Answer:These two style properties do two different things. visibility: hidden hides the element, but … Continue reading

Posted in Client Side Programming, CSS, HTML, JavaScript | Tagged , , , , | Leave a comment

Classes in Javascript

Source : >http://www.phpied.com/3-ways-to-define-a-javascript-class/ 3 ways to define a JavaScript class Introduction JavaScript is a very flexible object-oriented language when it comes to syntax. In this article you can find three ways of defining and instantiating an object. Even if you … Continue reading

Posted in Client Side Programming, JavaScript | Tagged , , | Leave a comment

More about regular expressions in Javascript

Aah !! Regular expressions I have got confused most of the times, I need to escape special characters when specifying a regular expression. Let us take an example of simple date formatdd/mm/yyyy There are two ways, you can specify your … Continue reading

Posted in Client Side Programming, JavaScript | Tagged , , | 3 Comments

How to expand collapse (toggle) div layer using jQuery

Thanks to http://designgala.com/how-to-expand-collapse-toggle-div-layer-using-jquery In almost all of my projects, I have been using jQuery to toggle the layer. So, I thought of sharing how easy it is to expand div layer and collapse panel using jQuery. When user clicks on … Continue reading

Posted in Client Side Programming, JavaScript, jQuery | Tagged , , | 5 Comments

How to get old Value with onchange() event in text box

You’ll need to store the old value manually. You could store it a lot of different ways. You could use a javascript object to store values for each textbox, or you could use a hidden field (I wouldn’t recommend it … Continue reading

Posted in Client Side Programming, HTML, JavaScript, jQuery | Tagged , , | 2 Comments