开发者

Why does my index page disappear only in Safari?

I have tried everything I can think of to track down this issue but can't turn up anythi开发者_StackOverflow社区ng. I'm using the jquery address plugin for my site.

After I login to my site the user gets redirected to the home page at which time I initialize the jquery address plugin. This works great on FF, IE, and Chrome, but Safari starts to load the page and then goes blank for some unknown reason.

The last block of code it hits is this:

$('a').address();

$.address.init(function(e) {
    // Address details can be found in the event object
});

// Handle handle change events
$.address.change(function(e) {

    var urlAux = e.value.split('=');
    var page   = urlAux[0];
    var arg  = urlAux[1];


    if (page == "/foo") {
        /* load foo */
    }
    else if (page == "/bar") {
        /* load bar */
    }
    else if (page == "/") {
        /* my index page loaded here */

        $.address.title("Home Page");

        $("#loadImage").show();
        $('#main').load("home.php", function (e) {
            e.preventDefault();
            $("#loadImage").hide();        
        });
    }
});

This get called outside of document ready. Any idea what might cause this issue in Safari?


Here's what I would check:

  • Check for js errors or warnings
  • Check for any failed net requests
  • Confirm that page and arg are both defined
  • Make sure all caching is disabled
  • Change the contents of home.php temporarily to make sure it's not something weird happening inside that request.
  • Check that it's working, but just being hidden (you are calling .hide() on an element...)

Remember: the Developer Tools are your friend (Command+Alt+i) Good Luck!

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜