Hey guys,
I'm trying to test a webpage on Opera. It works fine in IE and Firefox. I pared down all the javascript trying to isolate the problem but nothing helps.
The details:
Testing the page on a machine running XP Pro. I'm using an aspx file on localhost and running the page by right-clicking and Open With -> Opera.
What happens?
JavaScript - file://localhost/folder/pathtohtmlfile.htm
Event thread: click
Error:
Unhandled exception: [Object JavaObject]
The abbreviated html:
<input type=button value="Press the Button" id="btnTest" onclick="getProducts();"/>
The abbreviated javascript:
Can anyone see what I am missing here? The error I get from Opera is not helpful at all...
Thanks guys!
prgmrgirl
I'm trying to test a webpage on Opera. It works fine in IE and Firefox. I pared down all the javascript trying to isolate the problem but nothing helps.
The details:
Testing the page on a machine running XP Pro. I'm using an aspx file on localhost and running the page by right-clicking and Open With -> Opera.
What happens?
JavaScript - file://localhost/folder/pathtohtmlfile.htm
Event thread: click
Error:
Unhandled exception: [Object JavaObject]
The abbreviated html:
<input type=button value="Press the Button" id="btnTest" onclick="getProducts();"/>
The abbreviated javascript:
Code:
function createRequest()
{
var xmlHttp=null;
try
{
// Firefox, Opera 8.0+, Safari
xmlHttp=new XMLHttpRequest();
}
catch (e)
{
// Internet Explorer
try
{
xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
}
catch (e)
{
xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
}
}
return xmlHttp;
}
function getProducts()
{
request = createRequest();
if (request==null)
{
alert ("Your browser does not support AJAX!");
return;
}
request.onreadystatechange=stateChanged;
if (typeof netscape != 'undefined' && typeof netscape.security !='undefined')
{
netscape.security.PrivilegeManager.enablePrivilege('UniversalBrowserRead');
}
request.open("GET",url,true);
request.send(null);
}
function stateChanged()
{
if (request.readyState==4)
{
alert(request.responseText);
}
}
Can anyone see what I am missing here? The error I get from Opera is not helpful at all...
Thanks guys!
prgmrgirl