I'm using current jQuery plugin (address) and I have this code (I'm using "SEO" method of address plugin)
$(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:
when I try to add
alert(loc+' vs http://<?php echo $security->host()."'"; ?>+e.value);
after
if (loc != 'http://secret.riseofkings.net' + e.value) {
it gives me http://secret.riseofkings.net/game.php vs http://secret.riseofkings.net/ When I go to link (/game.php?what=map) it alerts http://secret.riseofkings.net/game.php vs http://secret.riseofkings.net/game.php?what=map
ENDUPDATE;
UPDATE2:
this is happening, for example in Mozilla/5.0 (Windows; U; Windows NT 5.1; cs; rv:1.9.1.2) Gecko/20090729 Firefox/3.5.2
ENDUPDATE;
but in some Firefox versions (3.XX) and IE there is an infinite loop. I do visit main page, and it starts to reload and to append #/game.php?r=something
to the end of address in address bar.
Don't you know what's wrong there?