AJAX to JQuery Conversion Assistance

michaelred

New Member
Would anyone be willing to help me out on this script?I just need someone to take this snippet of AJAX and basically reprogram it with jQuery so I can study it and learn more about how to use jQuery. This is a current working bit of AJAX that I am using and I think if I could see it in jQuery, it would jump start my learning process...So, if anyone would be so kind, this is the script:\[code\]function CreateXmlHttpObject() { //fuction to return the xml http object var xmlhttp=false; try{ xmlhttp=new XMLHttpRequest();//creates a new ajax object } catch(e) { try{ xmlhttp= new ActiveXObject("Microsoft.XMLHTTP");//this is for IE browser } catch(e){ try{ req = new ActiveXObject("Msxml2.XMLHTTP");//this is for IE browser } catch(e1){ xmlhttp=false;//error creating object } } } return xmlhttp;}function getMetaID(strURL){ var req = CreateXmlHttpObject(); // fuction to get xmlhttp object if (req) { req.onreadystatechange = function() { if (req.readyState == 4) { //data is retrieved from server if (req.status == 200) { // which reprents ok status document.getElementById('meta_id').innerHTML=req.responseText;//put the results of the requests in or element } else { alert("There was a problem while using XMLHTTP:\n"); } } } req.open("GET", strURL, true); //open url using get methodreq.send(null);//send the results }}\[/code\]And this is on the page that call the functions (PHP):\[code\] `echo '<select name="meta_id" onChange="getMetaID('."'".'http://www.mysite.com/backoffice/meta_tags/ajaxpageid.php?meta_id='."'".'+this.value)">';`\[/code\]It's a \[code\]<div>\[/code\] after that.Hopefully this is enough information to get it to make sense. I certainly appreciate any help...
 
Back
Top