![]() |
Problem with JScript in Internet Explorer
Hi:
I'm having an issue with a website design that I'm working on a web page...and I'm coming up with an Error after opening the web site Internet Explorer browser that says: Error A Runtime Error has occurred. Do you wish to Debug? Line: 413 Error: 'MSFPhover' is undefined When I run the debugger it points to this line of code: if(MSFPhover) { MSFPnav2n=MSFPpreload("_derived/dock pick up.gif"); MSFPnav2h=MSFPpreload("_derived/dock pick up_a.gif"); } I'm not really sure how MSFPhover would be defined. Would really appreciate any feedback on how this can go about being done. Thanks in advanced for any response. |
Re: Problem with JScript in Internet Explorer
netsurfer wrote:
> Hi: > > I'm having an issue with a website design that I'm working on a web > page...and I'm coming up > with an Error after opening the web site Internet Explorer browser that > says: > > Error > > A Runtime Error has occurred. Do you wish to Debug? > > Line: 413 > Error: 'MSFPhover' is undefined Look for the following abomination: MSFPhover = (((navigator.appName == "Netscape") && (parseInt(navigator.appVersion) >= 3 )) || ((navigator.appName == "Microsoft Internet Explorer") && (parseInt(navigator.appVersion) >= 4 ))); Change it to, or add: MSFPhover = document.images?true:false; Mick > > When I run the debugger it points to this line of code: > > if(MSFPhover) { MSFPnav2n=MSFPpreload("_derived/dock pick up.gif"); > MSFPnav2h=MSFPpreload("_derived/dock pick up_a.gif"); } > > I'm not really sure how MSFPhover would be defined. Would really > appreciate any feedback on how this can go about being > done. > > Thanks in advanced for any response. > |
Re: Problem with JScript in Internet Explorer
Mick White wrote on 23 apr 2005 in comp.lang.javascript:
> Look for the following abomination: > > MSFPhover = > (((navigator.appName == "Netscape") && > (parseInt(navigator.appVersion) >= 3 )) || > ((navigator.appName == "Microsoft Internet Explorer") && > (parseInt(navigator.appVersion) >= 4 ))); > > Change it to, or add: > > MSFPhover = document.images?true:false; > And change that to: MSFPhover = !!document.images ;-} -- Evertjan. The Netherlands. (Replace all crosses with dots in my emailaddress) |
Re: Problem with JScript in Internet Explorer
Evertjan. wrote:
> Mick White wrote >>MSFPhover = document.images?true:false; > And change that to: > > MSFPhover = !!document.images > > ;-} Yes, but I didn't want to give out cryptic advice... Mick |
Re: Problem with JScript in Internet Explorer
Mick White wrote:
> Evertjan. wrote: > >> Mick White wrote >>>MSFPhover = document.images?true:false; > > And change that to: >> >> MSFPhover = !!document.images >> > Yes, but I didn't want to give out cryptic advice... Cryptic to who? Shouldn't javascript programmers be expected to understand the language's operators, and the implied type-conversions in the above statement? But if you want to write that statement in a way that is theoretically unambiguous:- MSFPhover = Boolean(document.images); - should be sufficiently self-documenting. Though the reader is still expected to understand the actions of the Boolean constructor when called as a function. Though, given the reported error, the OP's problem looks more related to a failure to declare the variable in the global namespace. But the information provided is inadequate for a meaningful analyses. Richard. |
Re: Problem with JScript in Internet Explorer
Richard Cornford wrote:
>> >>>Mick White wrote >>> >>>>MSFPhover = document.images?true:false; >> >> > And change that to: >> >>>MSFPhover = !!document.images >>> >> >>Yes, but I didn't want to give out cryptic advice... [...] > > But if you want to write that statement in a way that is theoretically > unambiguous:- > > MSFPhover = Boolean(document.images); > > - should be sufficiently self-documenting. Though the reader is still > expected to understand the actions of the Boolean constructor when > called as a function. I doubt,in this case, that the OP would recognize "MSFPhover = !!document.images" as being implied type casting (to Boolean), I simply offered a more "readable" solution. I do like the Boolean constructor, though; it's certainly less cryptic. Mick |
Re: Problem with JScript in Internet Explorer
Mick White wrote on 24 apr 2005 in comp.lang.javascript:
> Evertjan. wrote: > >> Mick White wrote >>>MSFPhover = document.images?true:false; > > And change that to: >> >> MSFPhover = !!document.images >> >> ;-} > > > Yes, but I didn't want to give out cryptic advice... > Mick > true ..... false .... ;-) -- Evertjan. The Netherlands. (Replace all crosses with dots in my emailaddress) |
Re: Problem with JScript in Internet Explorer
Evertjan. wrote:
> Mick White wrote on 24 apr 2005 in comp.lang.javascript: > > >>Evertjan. wrote: >> >> >>>Mick White wrote >>> >>>>MSFPhover = document.images?true:false; >> >> > And change that to: >> >>>MSFPhover = !!document.images >>> >>>;-} >> >> >>Yes, but I didn't want to give out cryptic advice... >>Mick >> > > > true ..... false .... ;-) !false Mick > |
| All times are GMT. The time now is 11:54 PM. |
Powered by vBulletin®. Copyright ©2000 - 2013, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.