JavaScript and AJAX Web Development Tutorials

JavaScript, jQuery and AJAX (Asynchronous JavaScript and XML) Tutorials.
  Title / Author Replies
Views Reverse Sort Order
Sometimes, we need to rotate images on ours web pages, it may be ads or some simple images.Below you'll find the code for implementing the same. You can create as many image rotations you want, you just need to specify the urls of the images in an Array, and the object where the image will be...
26
376,492
Sometimes we need the user to enter only numbers in a text field, so I have some up with a small piece of JavaScript to do exactly that. It works for both IE and Firefox. function onlyNumbers(evt) { var e = event || evt; // for trans-browser compatibility var charCode = e.which ||...
18
202,542
Well all would have at some point of time needed to make a timer in JavaScript. I have made a timer in Javascript. The script shows the timer in the status bar,you can modify it to display the timer anywhere you want. Check out the code below: var mins,secs,TimerRunning,TimerID; ...
12
128,532
I needed to trim a string and also replace more than one spaces with a single space. The solution was simple with String.replace in JavaScript. Here's the code: var m = " My name is Pradeep "; m = m.replace(/^+/,'').replace(/+$/,'').replace(/{2,}/,' '); Making a function out of it. ...
7
115,463
We sometimes require to get the query parameters of an URL in JavaScript, here's how we can do that. // get the current URL var url = window.location.toString(); //get the parameters url.match(/\?(.+)$/); var params = RegExp.$1; // split up the query string and store in an //...
3
73,404
The Javascript Code : function autoCompleteDB() { this.aNames=new Array(); } autoCompleteDB.prototype.assignArray=function(aList) { this.aNames=aList;
37
67,992
Introduction One Javascript function that gets used such frequently than it should to be is "eval". "eval" evaluates the content of a text string passed to it and then executes it as if it were normal Javascript code.. Actually, we should never use eval for any purpose in our code, be it...
10
57,795
All web developers require to implement some JavaScript in their web applications. JavaScript arrays support a few in-built array manipulation methods like push,pop, but we might require more like unshift, shift, sort, shuffle, contains, clear and others. In JavaScript array being an...
4
55,670
Sometimes we need a sorted UL (un-ordered list) in a static page, like a blog, we can use JavaScript to the sort the list. I faced a similar problem with my blog, so I implement a simple bubble sort on the list, the list will be sorted if the browser supports JavaScript, else it will still...
5
48,169
Introduction Regular expressions is a form of pattern matching that you can apply on textual content. Take for example the DOS wildcards ? and * which you can use when you're searching for a file. Creating a Regular Expression You construct a regular expression in one of two ways: 1)...
4
38,185
There is a "bug" with the parseInt JavaScript function. The bug is not something that will affect you very often, but it is something you should be aware of. We've seen the bug in every browser except Opera. I've created a button to demonstrate the bug. The bug is that parseInt can return an...
5
36,079
There are hundreds of DHTML trees available online, most of them and written from scratch, some easy to understand and implement, while others are real pain to customize. Some of them need a JavaScript array to be populated or read an XML file to generate the tree. I've tried to develop one...
10
34,597
// The functions have been adapted from various sources // and re-written to provide maximum flexibility // and compatability with various browsers. //Global Declarations var ie = (document.all) ? true : false; function toggleClass(objClass){ // This function will toggle obj...
10
32,456
An operator is a symbol applied to data values that causes the computer to carry out a specific operation on that data . In VBScript, operators are used to perform an operation. For example, an operator could be used to assign a value to a variable. An operator could also be used to compare two...
0
29,972
Introduction A random number generator (often abbreviated as RNG) is a computational or physical device designed to generate a sequence of numbers or symbols that lack any pattern, i.e. appear random. Computer-based systems for random number generation are widely used, but often fall short of...
0
24,887
Introduction The second type of procedure is called a function. Like a subroutine, a function also holds a series of VBScript statements. The only difference is that a function actually returns a value to the code statement that called it. A function is a block of code that can be called from...
0
22,848
On many forums like DigitalPoint you would see lots of people claiming to be making thousands of $$$ with an ebook that costs $1 and have lots of screenshots to show you as well. Never trust those. This can be done in Firefox and IE7 with just one line of code. Yes its true. One line exactly. ...
11
20,075
I found that is difficult to search a simple javascript code about scrolling image slide. You can find them on Internet but they often are long and complex or hidden from us to prevent edit. I just found a simple way to resolve this. I hope it will help your editting easier to make it yours! We...
6
19,488
Essentially, writing some code to determine the number of days in a given month of a given year with javascript is not the worlds most difficult task. It is the type of exercise that one would expect to be given as a newbie developer during a lab or lecture. The solution normally involves...
0
19,255
Introduction Ajax, or AJAX, is a web development technique used for creating interactive web applications. The intent is to make web pages feel more responsive by exchanging small amounts of data with the server behind the scenes, so that the entire web page does not have to be reloaded each...
1
17,652