nikhilbansal
07-12-2011, 03:11 PM
Hi All,
Need some urgent.
We are having a javascript which is throwing the foll error
"Object doesn't support this property or method".
The javascript function being called is using a Scanner API. So this is using some ActiveX.
Below is the code for javascript
<script language="javascript">
// Initialize scanning
function OnLoad()
{
try
{
Scanner.OpenScanner();
// Scanner.ScanPriority = 0; // Set scanner to Foreground Read mode before enable scanning
// Scanner.EnableScanning(1);
document.forms["mobileform"]["rm07m-bwartwe[1]"].value = "101";
}
catch (e)
{
alert(e.message);
}
}
// Clean up
function OnUnload()
{
Scanner.CloseScanner();
// Calling Dispose is necessary for Pocket IE because of a Microsoft issue related to releasing object.
if (navigator.appName == "Microsoft Pocket Internet Explorer")
Scanner.Dispose();
}
// Scan through soft trigger
function Scan()
{
try
{
Scanner.SetSoftTrigger(1);
}
catch (e)
{
alert(e.message);
}
}
//User-defined function to format error codes.
//VBScript has a Hex() function but JScript does not.
function hex(nmb)
{
if (nmb > 0)
return nmb.toString(16);
else
return (nmb + 0x100000000).toString(16);
}
</script>
There is a object tag in html
<object id="Scanner"></object>
The javascript functions are called from body tag.
Can someone please provide some help.
Thanks,
Nikhil
Need some urgent.
We are having a javascript which is throwing the foll error
"Object doesn't support this property or method".
The javascript function being called is using a Scanner API. So this is using some ActiveX.
Below is the code for javascript
<script language="javascript">
// Initialize scanning
function OnLoad()
{
try
{
Scanner.OpenScanner();
// Scanner.ScanPriority = 0; // Set scanner to Foreground Read mode before enable scanning
// Scanner.EnableScanning(1);
document.forms["mobileform"]["rm07m-bwartwe[1]"].value = "101";
}
catch (e)
{
alert(e.message);
}
}
// Clean up
function OnUnload()
{
Scanner.CloseScanner();
// Calling Dispose is necessary for Pocket IE because of a Microsoft issue related to releasing object.
if (navigator.appName == "Microsoft Pocket Internet Explorer")
Scanner.Dispose();
}
// Scan through soft trigger
function Scan()
{
try
{
Scanner.SetSoftTrigger(1);
}
catch (e)
{
alert(e.message);
}
}
//User-defined function to format error codes.
//VBScript has a Hex() function but JScript does not.
function hex(nmb)
{
if (nmb > 0)
return nmb.toString(16);
else
return (nmb + 0x100000000).toString(16);
}
</script>
There is a object tag in html
<object id="Scanner"></object>
The javascript functions are called from body tag.
Can someone please provide some help.
Thanks,
Nikhil