I want to post some data to a file via ajax when somebody clicks a link. I have the following code which works in all the main browsers except IE 🙁
<script type="text/javascript">
$(document).ready(function() {
$('a').click(function() {
$.ajax({
url: '<?php echo SITE_URL ?>stats/add_click/',
type: 'POST',
datatype: 'html',
data: {
id: $(this).attr('data-id'),
ip: '<?php echo $_SERVER['REMOTE_ADDR'] ?>'
}
});
return true;
});
});
</script>
How do I get this to work in IE or debug the code for IE?
Regards
Try using the success callback of ajax to make the redirect. Sounds like IE is aborting the request