<body onload>

Discussion in 'HTML & Website Design' started by cucuru, Feb 3, 2010.

  1. #1
    hello, I would like to do something, but I'm afraid it's not possible, but I want a second opinion!

    Is it possible insert a variable in <body onload> I mean I have:

    
    <body onload="load('variable')";>
    
    Code (markup):
    But I would like to change 'variable', for example it could be set by GET.

    load is implemented with javascript in my code.

    Is it possible?

    Thanks!!!!

    Regards
     
    cucuru, Feb 3, 2010 IP
  2. osmasters

    osmasters Well-Known Member

    Messages:
    453
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    100
    #2
    I am not sure with your need but you can have like below.

    <script>
    var variable = <?=$_GET['getvariable'];?>
    </script
     
    osmasters, Feb 3, 2010 IP
  3. cucuru

    cucuru Peon

    Messages:
    24
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Thanks, but I have already solved it, I put:

    
    <body onload="load()">
    
    Code (markup):
    And in javascript I look for the GET variable with substring

    Thanks anyway.
     
    cucuru, Feb 3, 2010 IP