exteding onload event

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Andrew Poulos

    #1

    exteding onload event

    I have an external js file where I set an onload event:

    window.onload = function() {
    //blah
    }

    I import the file in the head of the pages I'm working on. Some of the
    pages need unique things set onload (including those in the external
    js). How can I extend the window.onload in the external js to include
    things unique to each page?


    Andrew Poulos
  • Evertjan.

    #2
    Re: exteding onload event

    Andrew Poulos wrote on 24 mrt 2005 in comp.lang.javas cript:
    [color=blue]
    > I have an external js file where I set an onload event:
    >
    > window.onload = function() {
    > //blah
    >}
    >
    > I import the file in the head of the pages I'm working on. Some of the
    > pages need unique things set onload (including those in the external
    > js). How can I extend the window.onload in the external js to include
    > things unique to each page?[/color]

    <script type='text/javscript'>
    var page=1
    </script>
    <script type='text/javscript'
    src='myScript.j s'>
    </script>

    =============== ============

    in myScript.js:

    window.onload = function() {
    if (page==1) {..set this..}
    if (page==2) {..set that..}
    }



    --
    Evertjan.
    The Netherlands.
    (Replace all crosses with dots in my emailaddress)

    Comment

    Working...