Name | Modified | Size | Downloads / Week |
---|---|---|---|
ReadMe.txt | 2011-04-08 | 1.6 kB | |
ajax_micro_mini.zip | 2011-04-07 | 3.4 kB | |
Totals: 2 Items | 5.0 kB | 0 |
There are 4 functions in the AJAX_micro_mini_lib. The parameters for postData function are postData(url, dataToSend, callbackFunction) To use this function postData('post_page.php', 'var_name=' + format(var_name.value) + '&var_name2=' + format(var_name2.value), process); This function post var_name and var_name2 data to the post_page.php page and if post_page.php generates any output the output is passes to the process function here. You can also use any other name for the function name process The process function should be in this way function process(response) { if (response == '') alert("No response found !"); else alert("Response " + response); } The parameters for getData functions are getData(dataSource, docID) To use this function getData('show_data.php', 'datas') This function grabs the output from the show_data.php page and append the result to the element which has ID of `datas`. The parameters for notifyData functions are notifyData(dataSource, callbackFunction) To use this function notifyData('get_data.php?mydata=Sourav&mydata2='+ format('hello'), process) This function send data to the get_data.php using GET method and also send 2 parameters, the output of the get_data.php page is send to process function. The parameter for the format function is format(text) To send a text which may contain any special charecter (space, ?, +, & etc) use this function. To use this function var1 = 'unescaped data'; var2 = format(var1); //now it's ready to send using any of the above method !