I have the following javascript code in a HTML document which loads Html in a div:
<script>
$(function(){
$("#submenu a").click(function(){
var page = this.hash.substr(1);
$.get(page+".html",function(gotHtml){
$("#contenedorprincipal").html(gotHtml);
})
});
});
</script>
In Firefox it runs perfectly, but in Chrome and IE it does not work. Any ideas or suggestions?
seems to me like it works in chrome… any way try this: http://jsfiddle.net/8daxU/
replace the wrapping function with (I added an alert just to show the hash – remove at afterwords)