我使用的是当前的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