Hi,I have just entered the world of jquery and pretty new to javascript too.I have a small javascript snippet like below:-
<script type="text/javascript">
$(function(){
$('a').click(function(event){
event.preventDefault();
$.get('/_add_navigation_',function(response){
$('#themaincontents').html(response);
})
})
</script>
The html looks like below:-
<a href="?toaddnavigation">CLICK Me</a>
<div id="themaincontents"></div>
On the server side I do an xhr header check by something like
if request.is_xhr: send response else:redirect somewhere
Now while this code works fine on chrome and opera , on firefox it is behaving a little weird. The server does not send back the reponse rather does a redirect. That means it says that there is no xhr header. Why should this happen while on the other two browsers it is working fine. (I am using Firefox 3.6.12) Update-Just had a look at the request headers of firefox and I find no X-Requested-With:XMLHttpRequest header, but it is present in chrome)