<body> onload function

Discussion in 'JavaScript' started by cagintranet, Jan 2, 2006.

  1. #1
    is there any way to automatically move to a "page bookmark" or "target" or what frontpage calls a "name" as soon as the page loads?

    im hoping there is a <body onload="xxx"> function available here to do this type of thing...
     
    cagintranet, Jan 2, 2006 IP
  2. the_pm

    the_pm Peon

    Messages:
    332
    Likes Received:
    33
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Do you mean to shift down to a different part of the page?

    onload="window.location=window.location + '#wherever'"
     
    the_pm, Jan 2, 2006 IP
    cagintranet likes this.
  3. cagintranet

    cagintranet Well-Known Member

    Messages:
    328
    Likes Received:
    12
    Best Answers:
    0
    Trophy Points:
    128
    #3
    Perfect! You get green my friend...
     
    cagintranet, Jan 2, 2006 IP
  4. the_pm

    the_pm Peon

    Messages:
    332
    Likes Received:
    33
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Glad I could help :)
     
    the_pm, Jan 2, 2006 IP
  5. legend2

    legend2 Well-Known Member

    Messages:
    1,537
    Likes Received:
    74
    Best Answers:
    0
    Trophy Points:
    115
    #5
    <body onLoad="javascript:myScript();">

    and have a script that may parse current url, do some other processing, add any part then what our friend above stated.

    script should look like

    <script language="javascript">

    function myScript() {

    //all your processing

    }

    </script>
     
    legend2, Jan 6, 2006 IP