I’ve read a few articles on here about people having issues with jQuery post in IE 9 and 8. I’ve followed the reccomendatinos and still can’t fix the issue.
The code is a simple video tracker, and for some reason, does not work in any version of IE.
Any ideas?
<script>
$(document).ready(function () {
var href = jQuery(location).attr('href');
var url = jQuery(this).attr('title');
var account = "parts_survey"; // Account name, no spaces
jQuery.post("http://mydomain.com/tracking/vt.php", { title: url, video_url: href, account: account } );
});
</script>
“Due to browser security restrictions, most “Ajax” requests are subject to the same origin policy; the request can not successfully retrieve data from a different domain, subdomain, or protocol.”
Try
$.post("/tracking/vt.php", { title: url, video_url: href, account: account } );For cross domain requests have a look at
$.getJSONhttp://api.jquery.com/jQuery.getJSON/#jsonp
http://en.wikipedia.org/wiki/JSONP#How_it_works