Results 1 to 6 of 6

Thread: body onload event not firing

  1. #1

    Thread Starter
    Frenzied Member Memnoch1207's Avatar
    Join Date
    Feb 2002
    Location
    DUH, Guess...Hint: It's really hot!
    Posts
    1,861

    body onload event not firing

    I have this code in two different applications, it's supposed to hide a "Processing Request, Please Wait..." message.
    VB Code:
    1. <script>
    2.    function hideObject(obj)
    3.    {
    4.       if (ns4)
    5.       {
    6.          obj.visibility = "hide";
    7.       }
    8.       if (ie4 || upLevel)
    9.       {
    10.          obj.style.visibility = "hidden";
    11.       }
    12.    }
    13. </script>
    14. <body onload="hideObject(Processing);">
    It works in one application, but not in another. I've tried putting an alert in the hideObject function in both applications, but it still only works in one application. Am I missing a setting or something??

    This is driving me nuts.
    Being educated does not make you intelligent.

    Need a weekend getaway??? Come Visit

  2. #2
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    Re: body onload event not firing

    Instead of just Processing, send

    hideObject(document.getElementById('Processing'));

    Or, just send hideObject('Processing')

    and set the var obj to getElementById in your function.

  3. #3

    Thread Starter
    Frenzied Member Memnoch1207's Avatar
    Join Date
    Feb 2002
    Location
    DUH, Guess...Hint: It's really hot!
    Posts
    1,861

    Re: body onload event not firing

    Nope, still not working...I can't even get this to fire.
    VB Code:
    1. <body onload="javascript:alert('Testing');">
    2. [color=red]Or[/color]
    3. <body onload="alert('Testing');">
    This has got me confused because, it works fine in another application, but not this one.
    Being educated does not make you intelligent.

    Need a weekend getaway??? Come Visit

  4. #4

  5. #5

    Thread Starter
    Frenzied Member Memnoch1207's Avatar
    Join Date
    Feb 2002
    Location
    DUH, Guess...Hint: It's really hot!
    Posts
    1,861

    Re: body onload event not firing

    This will work in a regular .html page
    Code:
    <body onLoad="alert('test');">
    But when I add the same code to a .aspx page within the VS.NET IDE, the onload event doesn't fire.
    Code:
    <body onload="alert('Test');">
    Being educated does not make you intelligent.

    Need a weekend getaway??? Come Visit

  6. #6
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    Re: body onload event not firing

    Do you have anything different on the page in question? Like extra page directives or different DTD declarations? This is quite odd, so I'm only venturing guesses.

    Can you post the page?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width