This is a discussion on "has no properties" within the JavaScript Forum section. This forum, and the thread "has no properties are both part of the Program Your Website category.
|
|
|
|
|
![]() |
||
has no properties
|
||
| Notices |
![]() |
|
|
LinkBack | Thread Tools |
|
|||
|
has no properties
I have a js function
function focus(WhereFocus){WhereFocus.focus} in a js script block. It's called from body onload event: <body onLoad="focus(<%=WhereFocus%>);"> this is within a vbscript function which writes the header of each page in an application; I pass this function the name of the page and where I want initial focus for the page to be. Many times it is simply 'document' but sometimes it's to a form element. It is getting written to html like this: <BODY onLoad="focus(document.login.ID);"> or <BODY onLoad="focus(document);"> It works fine in IE and NS7, though in NS7 if I invoke the js console I see the report: Error: WhereFocus has no properties In Netscape 4.7, focus is put correctly, but I get this error: WhereFocus is not a function. Anyone know what I'm doing wrong? Thanks - |
|
|
|
|||
|
A few things...
First off you're always asking for trouble when you use reserved words for function names or variables. So instead of calling your function "focus" which as you know is an object method name I'd call it "setfocus". After WhereFocus.focus try adding (); and sometimes, some browsers will want you to put javascript: in front of the function call.
|
|
||||
|
took the words right outta my mouth!
__________________
Rob - SEO Specialist Owner & Founder of Webforumz.com I am currently unavailable for private work
Last Blog Entry: Creative Labs threaten developer over home made drivers.... (Apr 1st, 2008)
|
![]() |
| Tags |
| properties |
| Thread Tools | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| CSS Height Properties | defy | Web Page Design | 2 | Oct 29th, 2007 13:23 |
| Some properties are inherited | begemot | Web Page Design | 3 | May 19th, 2007 18:37 |
| Getting properties of another file(ex.HTML)? | markor2d2 | JavaScript Forum | 2 | May 3rd, 2007 08:17 |
| Xsd Xml Schema - Same Element With Different Properties | myghty | Other Programming Languages | 0 | Aug 6th, 2006 12:30 |
| Changing properties of hyperlinks? | tom_king88 | Web Page Design | 7 | Jul 7th, 2006 19:58 |