我使用的是當前的jQuery插件(地址),我有這樣的代碼(我用的地址插件「搜索引擎優化」方法)無限循環 - jQuery插件(地址)
$(document).ready(function() {
$.address.crawlable(1).state('/').init(function() {
$('body').delegate('.ajax', 'click', function() {
$('.ajax').address();
});
$('.ajax').address();
}).change(function(e) {
var loc = document.location.href;
if (loc != 'http://secret.riseofkings.net' + e.value) {
var myStr = e.value;
myStr = myStr.substr(1);
if (myStr) {
$("#content").html('<img src="/images/ajax.gif" />');
$("#iframe_space").html('<iframe src="http://riseofkings.net/nothing.php" style="display:none"></iframe>');
var url = $(e).val().toLowerCase().substr(1).replace(/ /g, '%20');
$("#content").load(url + '&ajax=1', function() {
$("#iframe_space").html('');
}, function(errr) {
alert('Something went wrong. Sorry for problems');
});
}
}
});
});
UPDATE:
當我嘗試添加
alert(loc+' vs http://<?php echo $security->host()."'"; ?>+e.value);
後
if (loc != 'http://secret.riseofkings.net' + e.value) {
它給了我http://secret.riseofkings.net/game.php VS http://secret.riseofkings.net/ 當我去鏈接(/game.php?what=map)它提醒http://secret.riseofkings.net/game.php VS http://secret.riseofkings.net/game.php?what=map
ENDUPDATE;
UPDATE2:
發生這種情況,例如在Mozilla/5.0 (Windows; U; Windows NT 5.1; cs; rv:1.9.1.2) Gecko/20090729 Firefox/3.5.2
ENDUPDATE;
但在某些Firefox版本(3.XX)和IE中存在無限循環。我確實訪問了主頁,並開始重新加載並在地址欄中追加地址末尾的#/game.php?r=something
。
你不知道那裏有什麼問題嗎?
問題與新的代碼(刪除setTimeout和clearTimeout completelly)更新 – genesis
我會再看看... – Pointy