开发者

Javascript inconsitency with Safari/Mac

i'm trying to adapt this great script from Balupton's GitHub to build 开发者_JS百科a web app. Now everything works fine, but Safari/Mac fails on the first click, which is due to this part:

    var first = true;
    $(window).bind('statechange',function(){
      if ( first ) { first = false; return; };
          // stuff
    });

I've tested nn FF and Chrome for Mac and Linux, this works as it should (prevent reloading of the Ajax Part on the first load of the page) but in Safari it prevents the first user activated reload. If I comment out those bits:

    //var first = true;
    $(window).bind('statechange',function(){
  //    if ( first ) { first = false; return; };
          // stuff
    });

FF and Chrome for Mac and Linux will reload the Ajax bit directly on the first page load. Safari won't.

Can you tell me how to solve this?

Thanks, thomas

Edit: It turned out to be a problem in history.js ...

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜