satishgaudo.com

Understanding technology

Archive for the 'Javascript' Category

Use GET for AJAX Requests

The Yahoo! Mail team found that when using XMLHttpRequest, POST is implemented in the browsers as a two-step process: sending the headers first, then sending data. So it’s best to use GET, which only takes one TCP packet to send (unless you have a lot of cookies). The maximum URL length in IE is 2K, [...]

21 July 2009 at 19:40 - Comments
Thanks for posting about this, I would love to read more about this topic.

Calling Ajax script on onscroll event of an element:

In the example below element “adListContainer” is an div, on onscroll event of which an ajax function is called to load the next set of records. It is required that the function be [...]

17 July 2009 at 14:26 - Comments

function to check for valid date

function validDate(sDatePassed) { //if the date is in dd/mm/yyyy format then valid date returns 1else 0 if (sDatePassed.length > 0) { aDate = sDatePassed.split("/"); if (aDate.length != 3) return(0); if (aDate[1].length == 1) aDate[1]= "0"+aDate[1]; var iLeapyear = 0; // check whether the year is leap year – aleap year is div by 4 ,100, 400 if ((aDate[2] % 4) == [...]

14 June 2009 at 00:30 - Comments