2015-01-21 28 views

回答

0

嘗試使用

location.reload(true); 

應該Safari的工作) MDN link

+0

謝謝,但還是一樣 – olo 2015-01-21 03:59:51

+0

同樣在這裏的問題:/ – 2016-01-07 14:46:00

0

這個技巧爲我工作:/

https://gist.github.com/voku/854fef3b9a3fbf10624f

/** 
 
* reload on history-back with "history.pushState" usage 
 
* 
 
* Necessary hack because WebKit fires a popstate event on document load 
 
* https://code.google.com/p/chromium/issues/detail?id=63040 
 
* https://bugs.webkit.org/process_bug.cgi 
 
*/ 
 
$(window).bind('load', function() { 
 
    if (Modernizr.history) { 
 
    setTimeout(function() { 
 
     $(window).bind('popstate', function() { 
 
     location.reload(); 
 
     }); 
 
    }, 0); 
 
    } 
 
});