moving functions to an external file...

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • George Ziniewicz

    moving functions to an external file...

    ..
    I have an html file with javascript functions in the <head> section that
    work fine when called from events or instanced as objects.

    When I move the functions to an external js file they don't work (timers
    don't run).

    What pitfalls are there in having "external" functions, is there a scope
    problem like in c?

    zin

    --



  • Grant Wagner

    #2
    Re: moving functions to an external file...

    George Ziniewicz wrote:
    [color=blue]
    > .
    > I have an html file with javascript functions in the <head> section that
    > work fine when called from events or instanced as objects.
    >
    > When I move the functions to an external js file they don't work (timers
    > don't run).
    >
    > What pitfalls are there in having "external" functions, is there a scope
    > problem like in c?
    >
    > zin[/color]

    No, there should be no scope problem. Be aware that when moving inline
    JavaScript to an external file, you shouldn't include the <script></script>
    tags, nor should you include any HTML (such as comments <!-- -->).

    Are the function calls generating any errors (to check, double-click the yellow
    ! in the bottom left corner of IE, or use Tools -> Web Development ->
    JavaScript Console in Mozilla).

    --
    | Grant Wagner <gwagner@agrico reunited.com>

    * Client-side Javascript and Netscape 4 DOM Reference available at:
    *


    * Internet Explorer DOM Reference available at:
    *
    Gain technical skills through documentation and training, earn certifications and connect with the community


    * Netscape 6/7 DOM Reference available at:
    * http://www.mozilla.org/docs/dom/domref/
    * Tips for upgrading JavaScript for Netscape 6/7 and Mozilla
    * http://www.mozilla.org/docs/web-deve...upgrade_2.html


    Comment

    Working...