Hi again,
I try to use the following code to make an ajax request and I get back an error on firefox error console
"Error: Cannot read property "protocol" from undefined
Source File:
http://l.yimg.com/kj/yap/combo?/caja/js/ca...vR3E7lJbH0g-.jsLine: 1"
function makeRequest(url, postdata) {
var params = {};
postdata = gadgets.io.encodeValues(postdata);
params[gadgets.io.RequestParameters.METHOD] = gadgets.io.MethodType.POST;
params[gadgets.io.RequestParameters.POST_DATA]= postdata;
gadgets.io.makeRequest(url, response, params);
}
function response(obj) {
document.getElementById('interact').setTextValue('Populated!');
document.getElementById('population').setInnerHTML(obj.text);
}
function giveYoung(id){
document.getElementById('interact').setTextValue('Populating...');
var data = {
action : \"giveYoung\",
id : id
};
makeRequest(\"ajax.php\", data);
}
Thank you :)