Hi,
I have the following code and its working (as usual) in everything but IE. Its giving me a unexpected call to method or property access in Jquery and I have no idea how to debug it. Ive been using the IE developer toolbar, which is useless for this error and just gives me a line no 12 (inside the jquery script).
Any help is v much appreciated:
<script type="text/javascript">
$(document).ready(function () {
$.history.init(pageload);
$('a[href=' + window.location.hash + ']').addClass('selected');
$('a[rel=ajax]').click(function () {
var hash = this.href;
hash = hash.replace(/^.*#/, '');
$.history.load(hash);
$('a[rel=ajax]').removeClass('selected');
$(this).addClass('selected');
$('.loading').show();
getPage();
return false;
});
});
function pageload(hash) {
if (hash) getPage();
}
function getPage() {
hash = document.location.hash;
hash = hash.replace(/^.*#/, '');
var data = 'page=' + encodeURIComponent(hash);
$.ajax({
url: "index.php",
type: "POST",
data: data,
cache: false,
success: function (html) {
$('.loading').hide();
$('tbody').html(html);
}
});
}
</script>
Here is the history plugin: http://plugins.jquery.com/project/history
And here is the demo i have been following: http://plugins.jquery.com/project/history
Still changing window.location back to document.location doesnt seem to make a difference
Im lost on this one. When I change the tag im calling to it does post so its working, but in ie the design is all broken and the next links i click on dont post. Really Strange!!, works fine in FF,opera etc