Why does this not work in IE?

My site does not work in IE. I only have access to the Mac, so it's hard to check, and the parallels are meh. I could check once or twice, so I know that it does not work when it searches for youtube.

Close Popup> Hit 2010> Hit 10/20> Hit My Soul> Error

http://www.phishvid.com/

Can someone give some idea? Here is the code where it does not work:

Thanks!

+4
source share
2 answers

You are trying to make an AJAX request in another domain that is restricted by Same Origin Policy .

To take advantage of this JSONP so that your request uses JSONP callback=? to the URL of your request, this will help you overcome the cross-domain barrier.

Updated URL should look like

  $.getJSON("http://gdata.youtube.com/feeds/api/videos?callback=?&max-results=5&alt=json&q=phish " + song + " " + month2 + " " + day + " " + year, function (data) { //your callback code } 

Example

+4
source

My Messages IE "Access Denied" in jquery-1.4.4.min.js on line 138, char 355, which on your site looks like this:

 if(w){b.username?w.open(h,b.url,b.async,b.username,b.password):w.open(h,b.url,b.async);try{if(b.data!=null&&!l||a&&a.contentType)w.setRequestHeader("Content-Type", b.contentType);if(b.ifModified){c.lastModified[b.url]&&w.setRequestHeader("If-Modified-Since",c.lastModified[b.url]);c.etag[b.url]&&w.setRequestHeader("If-None-Match",c.etag[b.url])}o||w.setRequestHeader("X-Requested-With","XMLHttpRequest");w.setRequestHeader("Accept",b.dataType&&b.accepts[b.dataType]?b.accepts[b.dataType]+", */*; q=0.01":b.accepts._default)}catch(I){}if(b.beforeSend&&b.beforeSend.call(b.context,w,b)===false){b.global&&c.active--===1&&c.event.trigger("ajaxStop");w.abort();return false}b.global&& c.triggerGlobal(b,"ajaxSend",[w,b]);var L=w.onreadystatechange=function(m){if(!w||w.readyState===0||m==="abort"){J||c.handleComplete(b,w,e,f);J=true;if(w)w.onreadystatechange=c.noop}else if(!J&&w&&(w.readyState===4||m==="timeout")){J=true;w.onreadystatechange=c.noop;e=m==="timeout"?"timeout":!c.httpSuccess(w)?"error":b.ifModified&&c.httpNotModified(w,b.url)?"notmodified":"success";var p;if(e==="success")try{f=c.httpData(w,b.dataType,b)}catch(q){e="parsererror";p=q}if(e==="success"||e==="notmodified")d|| c.handleSuccess(b,w,e,f);else c.handleError(b,w,e,p);d||c.handleComplete(b,w,e,f);m==="timeout"&&w.abort();if(b.async)w=null}};try{var g=w.abort;w.abort=function(){w&&Function.prototype.call.call(g,w);L("abort")}}catch(i){}b.async&&b.timeout>0&&setTimeout(function(){w&&!J&&L("timeout")},b.timeout);try{w.send(l||b.data==null?null:b.data)}catch(n){c.handleError(b,w,null,n);c.handleComplete(b,w,e,f)}b.async||L();return w} 

the actual character number 355 is the first b, so I assume you encountered a bug in jQuery 1.4.4? you can either try to use the previous version (if you are not using some 1.4.4 specific functions) or replace the .min.js file with the full jquery file, insert the debugger statement in the jquery file in this place (before it throws an exception) and try to debug to find out what is wrong. You can, for example, use the Microsoft Visual Web developer for debugging, or if the same problem occurs in IE9, it also has a built-in .js-debugger

EDIT: after looking at the full jQuery code you posted, it is clear that the problem is that jQuery in this case is trying to use a standard ajax call, not JSONP. (standard ajax is allowed only on the server that served javascript)

0
source

Source: https://habr.com/ru/post/1337266/


All Articles