'object doesn't support this property or method'

P

punjab_tom

hello

i have a problem when it comes to running my intranet site.. it gives
msgbox in internet explorer saying 'object doesn't support this
property or method' and line 260.. I identified line 260 below...

I dont know javascript very well; but I would really appreciate some
help with this.

I believe that this is handling keystrokes- and it does let me press
CTRL + N; but it's just a little bit confusing..

I didn't CHANGE this code; it's just frustrating because the website
throws an error and now it wont do anything else.

also.. is there something similiar to 'on error resume next' for the
javascript world?
thanks





function SetChangedFromInput(bFlag)
{
var k = window.event.keyCode;
var arKodes;//Codes of valid keys
var bReturn = true;
arKodes =
Array(8,32,46,106,107,109,110,111,186,187,188,189,190,191,192,219,220,221,222);
if ((k >= 65 && k <= 90) ||
(k >= 48 && k <= 57) ||
(k >= 96 && k <= 105))
{
bReturn = false;
}
for (var i in arKodes)
{
if (k == arKodes)
bReturn = false
}

//Handled Ctrl-N pressing
if ((k == 110 || k == 78) && event.ctrlKey == true)
LINE260-> return;

if (!bReturn)
{
SetChanged(bFlag);
}
return window.event;

}
 
G

GLC

hello

i have a problem when it comes to running my intranet site.. it gives
msgbox in internet explorer saying 'object doesn't support this
property or method' and line 260.. I identified line 260 below...

IE does not report line numbers correctly and is usually one line off.
Though, I have seen it be further off, and I can't remember if it is
one more or one less.
also.. is there something similiar to 'on error resume next' for the
javascript world?
thanks

Javascript does have exception handling.
Look up try and catch.
//Handled Ctrl-N pressing
if ((k == 110 || k == 78) && event.ctrlKey == true)
LINE260-> return;

try{
if ((k == 110 || k == 78) && event.ctrlKey == true)
return;
}
catch(e){
alert("An error occured!");
}
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,743
Messages
2,569,478
Members
44,899
Latest member
RodneyMcAu

Latest Threads

Top