CrispinP
Well-known member
Folks,
I have a bbcode which does a php callback which loads a template. This works well but from in the template I call some js (which calls ok) but the js makes an ajax call back to the server. The controller, for now, simply returns an empty array / json string.
If I am logged in I get the security token error. If I am not logged in it works as expected.
This happens regardless of user., browser etc. Chrome incognito does the same.
I have exact same code / method in another add-on which works without a problem. It's as if the code, when called from within a post, does not like something.
Pasting the url in the browser returns the empty json as expected.
Any ideas why this might happen?
Cheers,
C
I have a bbcode which does a php callback which loads a template. This works well but from in the template I call some js (which calls ok) but the js makes an ajax call back to the server. The controller, for now, simply returns an empty array / json string.
If I am logged in I get the security token error. If I am not logged in it works as expected.
This happens regardless of user., browser etc. Chrome incognito does the same.
I have exact same code / method in another add-on which works without a problem. It's as if the code, when called from within a post, does not like something.
Pasting the url in the browser returns the empty json as expected.
Code:
function reloadData(){
var url = "http://qa.landcruiserclub.net/community/mymaps/GetGeo";
XenForo.ajax(
url,
{}, // extra data to pass
function(ajaxData, textStatus)
{
if (XenForo.hasResponseError(ajaxData))
{
alert("Could not load map data. " + ajaxData.error);
return false;
}
alert('here');
}
);
}
Any ideas why this might happen?
Cheers,
C