[Wylug-help] javascript function defined???

Towle, William william.towle at echostar.com
Wed Oct 8 09:14:15 UTC 2008


  In a simple test with just a <script language="javascript"
src="include.js"></script>, a subsequent document.writeln(typeof(foo));
works as expected in both IE and Konqueror for me.

  It is worth noting that IE appears to be somewhat temperamental about
the other HTML in the
containing page. For example, if I have a stray '<' outside a comment
(which should technically be
&lt; of course), it goes on to report the function is undefined even
though include.js hasn't
changed.
  There doesn't appear to be a "page has errors" warning emitted for
this.

HTH,
  W.


> -----Original Message-----
> From: wylug-help-bounces at wylug.org.uk 
> [mailto:wylug-help-bounces at wylug.org.uk] On Behalf Of Gary Stainburn
> Sent: 07 October 2008 20:13
> To: wylug-help at wylug.org.uk
> Subject: [Wylug-help] javascript function defined???
> 
> Hi folks,
> 
> here's one for you.
> 
> is it possible to check if a function (defined in another .js 
> file) has been 
> defined?
> 
> I know you can use typeof() == 'undefined' for variables, 
> objects etc., but it 
> doesn't seem to be working with functions.
> 
> Gary
> -- 
> Gary Stainburn
>  
> This email does not contain private or confidential material as it
> may be snooped on by interested government parties for unknown
> and undisclosed purposes - Regulation of Investigatory Powers 
> Act, 2000     
> 
> _______________________________________________
> Wylug-help mailing list
> Wylug-help at wylug.org.uk
> https://mailman.lug.org.uk/mailman/listinfo/wylug-help
> 



More information about the Wylug-help mailing list