I'm building a Joomla extension and i'm trying to send some data to a php script, with MooTools, to be saved in a database.
This is the code for the request :
myReq: new Request({
url: '/index.php?option=com_calculator&task=saveData',
method: 'post',
onSuccess: function (responseText, responseXML) {
console.log(reponseText);
}
})
When i run it Firebug throws this error:
Permission denied for <http://localhost> to get property XMLHttpRequest.channel
I've read around and think it c开发者_开发问答ould be related to the same domain policy for Ajax,but i couldn't get a fix on it.
Try this:
var requestHTMLData = new Request.HTML ({
url: 'index.php?option=com_calculator&task=saveData',
update: $('contains')
}).send();
$('contains')
is those div id that your want to response.
for more info see Gantry Framework
精彩评论