javascript - firefox gives XMLHttpRequest "null" error accessing Vimeo API but no error from Youtube or other browsers -


I tried to see it on Google, and here are other similar questions, but I still can not understand it . I moved away from a proxy request model (pulling video data from YouTube and Vimeo API to an AJAX request on a script on your server which then requests an external server) to take it to a completely browser-based solution. Works right with youtube, but seems to trigger an exception in vimeo firefox (but works fine in konqueror-webkit) Firefox 17.0.1 Here's the relevant code snippet Is:

  function getAsync (url2) {console.log ('async url:' + url2); If (window.XMLHttpRequest) {req = new XMLHttpRequest (); } And if (window.ActiveXObject) {req = new ActiveXObject ("Microsoft.XMLHTTP"); } If (req! = Undefined) {req.onreadystatechange = function () {console.log ("statechanged");}; console.log ('3a'); try {console.log ("try ..."); Req.open ("GET", url2, incorrect); // 3rd param is whether the "async"} hold (error) {console.log ('err name = [' + err.name + ']: err.message = [' + err.message + '] (line' + Err.lineNumber + ')'); } Console.log ('3b'); try {console.log ('About sending ...'); req.send (""); } Catch (err) {console.log ('err name = [' + err.name + ']: err.message = [' + err.message + '] (line' + err.lineNumber + ')'); } Console.log ('4'); If (req.readyState == 4) {// only if req is "loaded" console.log ('5'); If (req.status == 200) {// only if "OK" console.log ('6a'); Return req.responseText; } And {console.log ('6b'); Return "XML error:" + req.status + "" + req.statusText; }}}}   

This logs the following for vimeo:

async url:
3a
try ...
3b
About sending ... # err name = [NS_ERROR_NOT_INITIALIZED]: err.message = [Component Initiation Not done] (line 211)
4

(line 204 req.open ("GET", url2, false); And from line 211 to req.send (""); )

and for YouTube:

async url:
3a
try


StatBried
3b
About to send ...
StateWorld




6A < / blockquote>

What do I Am doing wrong Or, how can I fix this?

I found to be connected to this problem, which does not seem to reveal my debugging if someone It also runs in this problem, so here it has been solved:

It seems that my Javascript blocker (Noscript) blocked the VEMEO dot com domain, which for some reason did the XMLHttpRequest successfully Was necessary to do Once I saw that it has been said that the domains are blocking (since my own server has not been blocked, and it does not use any of the external scripts s, it was weird This is what it says) I have enabled vimeo.com, tried it again, and it worked perfectly. So I think this is how XMLHttpRequest is implemented, perhaps trying to run a http request on a Javascript call or some other domain (perhaps one of the more knowledgeable folks you can make it clear for us) but In any case, my issue was resolved on this issue. Hope that helps out any other desperate googlers out there.

Comments

Popular posts from this blog

Verilog Error: output or inout port "Q" must be connected to a structural net expression -

jasper reports - How to center align barcode using jasperreports and barcode4j -

c# - ASP.NET MVC - Attaching an entity of type 'MODELNAME' failed because another entity of the same type already has the same primary key value -