I tried researching this issue on multiple platforms, including Google and other forums, but I am still unable to resolve it. I recently transitioned from a proxy request approach (using AJAX to communicate with a server-side script that then interacts with an external server) to a fully browser-based method for retrieving video data from the Youtube and Vimeo APIs. Although everything functions smoothly with Youtube, I encountered an exception in Firefox when working with Vimeo (although it works fine in Konqueror using Webkit). The version of Firefox I am using is 17.0.1. Here is the relevant excerpt of the code:
function getAsync(url2)
{
console.log('async url: ' + url2);
if (window.XMLHttpRequest) {
req = new XMLHttpRequest();
} else 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, false); // 3rd param is whether "async"
} catch (err) {
console.log('err name=['+err.name + ']: err.message=[' + err.message + '] (line ' + err.lineNumber + ')');
}
console.log('3b');
try {
console.log(' about to send... ');
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 ;
}
else
{
console.log('6b');
return "xml error: " + req.status +" "+req.statusText;
}
}
}
}
This records the following information for Vimeo:
async url:
3a
try...
err name=[null]: err.message=[] (line 204)
3b
about to send...
err name=[NS_ERROR_NOT_INITIALIZED]: err.message=[Component not initialized] (line 211)
4
(Line 204 corresponds to req.open("GET", url2, false);
and line 211 to req.send("");
)
And the following for YouTube:
async url:
3a
try...
statechanged
3b
about to send...
statechanged
4
5
6a
What could be causing this issue? Any suggestions on how to address it?