|
Schulpastoral und Internet
Themen Specials
Suche auf www.schulpastoral.de
Bibliothek auf www.rpi-virtuell.de
|
Home
>>
RSS Center
>>
Solving ajax giving cross-domain error or responding empty
RSS Center
XOOPS.org
(08.12.2025 01:08)
Solving ajax giving cross-domain error or responding empty
(09.03.2012 19:23)
When assigning XOOPS_URL to a java_script variable in eighter preloads or specific pages.
Most often the browser will deny your request and return only an empty respond. But not give error. This can be seen in FireBug's console when the requests is returning code "200 OK" but text is in red color = empty result. Very annoying The problem is between Xoops Cookie and browser. I noticed this when being logged in to a xoops page and closing the page without logging out. When re-opened the ajax running in my preloads (in this case XIM and Smallworld) was denying sending messages or posting to the wall. Also this is a problem if you log out from http://domain.com and open http://www.domain.com . There are as I see this 2 solutions. 1) Everytime you finish browsing do log out. Another solution is to define the java_script var used in ajax requests according to actual browser adress. Add a function to your page (if you add to include/functions.php remember to include this page in preloads or the page your working on)
/**
In your page reset the var like this
// Check if request url is with www or without
The var smallworld_url will now be according to your browser adress and this way not result in ajax cross-browser error. execution time : 0.037 sec
|