JavaScript is the world’s most popular programming language. JavaScript is the programming language of the Web. JavaScript is easy to learn. In this simple tutorial we will learn to remove a property of a JavaScript object. A sample JavaScript object…
Tag: Javascript
LocalStorage in JavaScript
LocalStorage is a type of web storage that allows JavaScript websites and apps to store and access data right in the browser with no expiration date. This means the data stored in the browser will persist even after the browser…
Validating php multiple-value checkbox form element with javascript
In php a multiple-value form element such as checkbox is named suffixed with a set of square brackets. For example, My commonly used colors are: <form action=”index.php” name=”myform” method=”post” onsubmit=”return validate_form();”> <input type=”checkbox” name=”colors[]” value=”red” /> <input type=”checkbox” name=”colors[]” value=”green”…
Useful trim prototype (function) in core javascript
Below is the most commonly used trim prototype/function in javascript. Posting for reference. String.prototype.trim = function() { return this.replace(/(^\s*)|(\s*$)/g,””) } You can place the above code (wrapped in <script></script>) inside <header> section of your web page or you can place…
A simple javascript image slide show using setTimeout and jQuery
Just now i created a small slideshow. The slideshow uses some static images stored in a javascript object (array) and runs till the last image in this array. For example, the array:
Form DOM element not recognized (created) in ajax form in IE when placed with end tag missing
Skipping a form end tag </form> costed me almost a day (i had to go to bed abandoning the fixing for some time though;)). I had been using ajaxForm with jQuery to submit ajax form which was placed on a…
Javascript common mistake of comparing with NaN and not with isNaN
Recently, i fell into the trap of NaN and isNaN and it turned me pulling my hair for quite a few good minutes. Thats why i decided to make a note of it here for a recitation and as a…