Hi
New to all this so ill try asking you guys.
Im creating a ajax based page so i needed to use jquery to fix the back button.
Found Ben alman's BBQ library and it works perfectly, almost. :P
The problem is that when i use onclick to run an ajax function. It doesnt work untill i have refreshed the page.
The two doesnt seem to work together :S
Why is this? Is this suppose to happen or?
The function that im trying to run on onclick is this
function xmlhttpPost(strURL, input_value) {
var xmlHttpReq = false;
var self = this;
if (window.XMLHttpRequest) {
self.xmlHttpReq = new XMLHttpRequest();
} else if (window.ActiveXObject) {
self.xmlHttpReq = new ActiveXObject("Microsoft.XMLHTTP");
}
self.xmlHttpReq.open('POST', strURL, true);
self.xmlHttpReq.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
self.xmlHttpReq.onreadystatechange = function() {
if (self.xmlHttpReq.readyState == 4) {
updatepage(self.xmlHttpReq.responseText);
}
}
self.xmlHttpReq.send(getquerystring(input_value));
}
function getquerystring(input_value) {
qstr = 'w=' + escape(input_value); // NOTE: no '?' before querystring
return qstr;
}
function updatepage(str){
document.getElementById("result").innerHTML = str;
}
Any help would be appreciated :)