WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] jQuery.load gives me a 404 Not Found in WPMU (2 posts)

  1. spstieng
    Member
    Posted 3 years ago #

    I've developed a plugin that works fine on a single site WP.
    But when testing it on WPMU with subdomain, I get a 404 Not Found error.

    The strange thing is that the content is loaded even though I get the error message - but the content is never displayed.

    You can see a screenshot here:
    http://www.stiengenterprises.com/download/tmp/jQuery_load_error.png

    The jQuery code looks like this:

    jQuery.post("/wp-content/plugins/wp-eventcal/eventcal_jquery.php", { instance: 'getEvent', eventID: eventID },
      function(event)
      {
        alert(event); // This never fires
    
      }, "json");

    The alert never fires, but data is retrieved.
    Any suggestions to how I can fix this?

  2. spstieng
    Member
    Posted 3 years ago #

    I got the answer over at Stackoverflow.

    It turns out that I have to include header('HTTP/1.1 200 OK'); directly after require_once($_SERVER['DOCUMENT_ROOT'].'/wp-blog-header.php');.

    So the code will look like this:

    require_once($_SERVER['DOCUMENT_ROOT'].'/wp-blog-header.php');
    header('HTTP/1.1 200 OK');

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.