Ajax lookup function ~ Ajax Training, Learn Ajax Video Tutorials Online, Ajax Examples
Ajax Training, Learn Ajax Video Tutorials Online, Ajax Examples: Ajax lookup function

Ajax lookup function

Here is a simple look up function using ajax (XMLHttpRequest object).

function lookup(tbl,res,fld,val) {
var req;
var url='lookup.php?tbl='+tbl+'&res='+res+'&fld='+fld+'&val='+val;
req = false;
// branch for native XMLHttpRequest object

if(window.XMLHttpRequest) {
try {
req = new XMLHttpRequest();
} catch(e) {
req = false;
}
// branch for IE/Windows ActiveX version
} else if(window.ActiveXObject) {
try {
req = new ActiveXObject("Msxml2.XMLHTTP");
} catch(e) {
try {
req = new ActiveXObject("Microsoft.XMLHTTP");
} catch(e) {
req = false;
}
}
}
if(req) {
//req.onreadystatechange = processReqChange;
req.open("GET", url, false);
req.send('-');
}
return req.responseText;
}

Related Posts by Categories

3 comments:

Hapi said...

hello... hapi blogging... have a nice day! just visiting here....

File said...

Download Forum Poster V3 3.0 at FileAfro.com

http://www.fileafro.com/view_forum-poster-v3-30.html

Keyword said...

hello... you may submit this blog to my webBlog Directory, keyworddir.info.. have a nice day!

Keyword Directory

Useful Links on Adobe Flex

Your Ad Here

Latest Books on Adobe Flex