Update: This question has been solved, so the buggy Firefox behavior will no longer appear when loading my example webpage
My webpage has very long passages of text, so I want to make each paragraph its own permalink. To do this, I use jQuery to add an anchor and link to each paragraph after the page loads. This worked perfectly in Chrome. To get this to work in IE I added an explicit jQuery focus() function after applying the anchors. However, this does not work in Firefox if I either load the page for the first time or refresh it (e.g. http://www.readsherlock.com/study.php#p4). The relevant javascript is pasted below.
$(document).ready(function() {
var i = 1;
$("#text p").each(function(i){
$(this).html('<a name="p' + i + '" href="#p' + i++ + '">' + $(this).html() + '</a>');
});
if(location.hash != '')
$(location.hash).focus();
});
Thanks!