• Resolved jimaek

    (@jimaek)


    For some reason when i add the div what it does is to output the website inside it in a loop.

    Example:
    function test_ajax(){
    echo “Testing ajax”;
    }

    I created the div and putted it in sidebar, after the page is loaded and ajax kicks in, in the div appears the web site itself, and in that website in the sidebar another one… you get the idea.
    But in the preview in dashboard everything works ok.

    No idea why it happens to me

    http://wordpress.org/extend/plugins/ajaxize/

Viewing 6 replies - 1 through 6 (of 6 total)
  • Thread Starter jimaek

    (@jimaek)

    Never mind, i fixed it 🙂

    The working version http://pastebin.com/5rTYCag7

    Plugin Author yoav.aner

    (@yoavaner)

    Hey jimaek,

    Sorry I didn’t check the forums for a while. Had a quick look at your change, and not sure it’s ideal really. You should really load ajaxize from the same page that your content is loading from. This would allow your ajaxized function to have the same context as the page you’re on. Some functions of course don’t need this, but some certainly do.

    I’d be grateful if you can let me know how to reproduce this loop. I could then look at some generic way to avoid it. This could improve ajaxize for other users too. It’s usually down to something not dealing with the ajaxize call correctly, and mistaking it for a request for the actual page, but I wasn’t able to reproduce this so far.

    Cheers
    Yoav

    Plugin Author yoav.aner

    (@yoavaner)

    I’m not sure whether this is the case for you, but I have come across a loop when ajaxize is used together with nginx.

    For some reason, nginx and wordpress support permalinks a little differently, which caused the ajaxize parameters to get dropped unless you were on the homepage itself.

    The solution in this case was to make sure that your nginx is configured with this directive:

    try_files $uri $uri/ /index.php?q=$uri&$args

    see here for a little more info

    Thread Starter jimaek

    (@jimaek)

    Yes im using nginx as you guessed. I think your are correct.
    But i will try your fix later as i dont want to play with the production right now.

    Thank you 🙂

    Plugin Author yoav.aner

    (@yoavaner)

    Thanks jimaek!

    It’d be really useful if you could let me know when you get a chance to test it. I am wondering if there’s a reliable way to detect the webserver (and potential mis-configuration) from within the plugin itself so to avoid infinite loops… At the very least I will try to include some comments / update the faq to make sure people are aware of it.

    Yoav

    Plugin Author yoav.aner

    (@yoavaner)

    Didn’t hear back from OP for some time, so marking as resolved

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘[Plugin: Ajaxize] Infinite loop’ is closed to new replies.