Junior Member
Junior Member
zatacka   04-10-2005, 23:02
#1

Seems there are many reasons AJAX may not work. I managed to isolate my problem down to sajax_get_my_uri() in sajax.php. It wasn't returning anything. As such the uri var in the JS wasn't set, and(I'm guessing, as I don't know AJAX) the script didn't know where to send it's input. Well, anyway, I replaced

`function sajax_get_my_uri() {

    global $REQUEST_URI;`

    `return $REQUEST_URI;

}`

with

`function sajax_get_my_uri() {

    /*global $REQUEST_URI;`

    `return $REQUEST_URI;*/ 

    return $_SERVER["REDIRECT_SCRIPT_URI"]."?".$_SERVER["REDIRECT_QUERY_STRING"];

}`

and now it works beautifully. Now, I don't know AJAX, so for all know, giving it the whole uri might be overkill, so I'll leave the actual bugfixing to Tristan.

Edit: Oh, I almost forgot, you can check if your uri variable is set by viewing the source and searching(Ctrl+F) for uri = ". If it just says uri = ""; you will probably have to fix it.

Developer
Developer
trisweb   05-10-2005, 18:10
#2

Wow, interesting. Sajax always seemed kind of hacky to me. I'm looking for other libraries that might be better....

Member
Member
Tobi_Kellner   08-01-2006, 15:28
#3

Yes, I also discovered that one after half a day of debugging :-)

I put in

function sajax_get_my_uri() {
    global $_SERVER;
    return $_SERVER['REQUEST_URI'];
}

and it works fine.

I guess the reason is that $REQUEST_URI is a shortcut for $_SERVER['REQUEST_URI'], which is set in some versions of PHP and not in others.

On a slightly different note, the debug mode cannot be activated, setting
$sajax_debug_mode = 1
does not work (weird, the code looks ok), so you'll have to set it in line 86 manually.

Tobi

Member
Member
Tobi_Kellner   08-01-2006, 15:30
#4
  
Powered By MyBB, © 2002-2026 MyBB Group.
Made with by Curves UI.