My problem is that my code is really long and complicated, because it's normal xmlhttp and I want to switch it over to jQuery. I'm pretty sure there's shorthand functions for it? This is my current code:
function getContent() {
if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari
xmlhttp=new XMLHttpRequest();
} else {// code for IE6, IE5
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
}
xmlhttp.onreadystatechange=function() {
if (xmlhttp.readyState==4 && xmlhttp.status==200) {
replace_page = xmlhttp.responseText;
doc.getElementById("content").innerHTML = replace_page;
$("#content").children().hide();
$("#content").children().fadeIn("slow");
//do some other stuff
}
navigating = false;
};
xmlhttp.open("GET",site_location+"/pages/"+page+".php",true);
xmlhttp.send();
}
I found this example, and this works perfectly, but I'm also going to have to use this for forms...
Is there a simple way I can change it? I know it'll probably involve the serialising function, right?