Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. Body on load, doesn't seem to work?

Body on load, doesn't seem to work?

Scheduled Pinned Locked Moved Web Development
adobejavascripthtmlhelpquestion
4 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • O Offline
    O Offline
    offroaderdan
    wrote on last edited by
    #1

    Experts, I have a website i am currently (trying) to make :) I have a piece of code which goes

    <body onLoad="disptime()","MM_CheckFlashVersion('7,0,0,0','Content on this page requires a newer version of Adobe Flash Player. Do you want to download it now?);DisplayDIV('SubKicks');HideDIV('LeftDiv');HideDIV('RightDiv');HideDIV('FrontDiv');HideDIV('SideDiv');">

    Which doesn't seem to do what it is suppossed to do. disptime is a javaScrpt function which displayes the current time. the MM checks flash is because i have some videos i have added. Now the main thing that isn't working is this part DisplayDIV('SubKicks');HideDIV('LeftDiv');HideDIV('RightDiv');HideDIV('FrontDiv');HideDIV('SideDiv'); In my HTML code i have Display and Hide javascript functions, which will allow me to hide and show certain DIV tags. I am confused at why the body tag doesn't like the display and hiding divs as this EXACT code works fine onClick on a button..... (I need it onLoad) If anybody can help that would be great. I assume i have missed out a semi colon or something somewhere but don't actually know where!??!?!? Many thanks Dan

    N 1 Reply Last reply
    0
    • O offroaderdan

      Experts, I have a website i am currently (trying) to make :) I have a piece of code which goes

      <body onLoad="disptime()","MM_CheckFlashVersion('7,0,0,0','Content on this page requires a newer version of Adobe Flash Player. Do you want to download it now?);DisplayDIV('SubKicks');HideDIV('LeftDiv');HideDIV('RightDiv');HideDIV('FrontDiv');HideDIV('SideDiv');">

      Which doesn't seem to do what it is suppossed to do. disptime is a javaScrpt function which displayes the current time. the MM checks flash is because i have some videos i have added. Now the main thing that isn't working is this part DisplayDIV('SubKicks');HideDIV('LeftDiv');HideDIV('RightDiv');HideDIV('FrontDiv');HideDIV('SideDiv'); In my HTML code i have Display and Hide javascript functions, which will allow me to hide and show certain DIV tags. I am confused at why the body tag doesn't like the display and hiding divs as this EXACT code works fine onClick on a button..... (I need it onLoad) If anybody can help that would be great. I assume i have missed out a semi colon or something somewhere but don't actually know where!??!?!? Many thanks Dan

      N Offline
      N Offline
      Not Active
      wrote on last edited by
      #2

      <body onLoad="disptime()";"MM_CheckFlashVersion('7,0,0,0','Content on this page requires a newer version of Adobe Flash Player. Do you want to download it now?');DisplayDIV('SubKicks');HideDIV('LeftDiv');HideDIV('RightDiv');HideDIV('FrontDiv');HideDIV('SideDiv');">

      Looks like you are missing the closing single quote on your string literal "Content on this page...". Also there should be a semicolon after disptime() rather than a comma


      I know the language. I've read a book. - _Madmatt

      N 1 Reply Last reply
      0
      • N Not Active

        <body onLoad="disptime()";"MM_CheckFlashVersion('7,0,0,0','Content on this page requires a newer version of Adobe Flash Player. Do you want to download it now?');DisplayDIV('SubKicks');HideDIV('LeftDiv');HideDIV('RightDiv');HideDIV('FrontDiv');HideDIV('SideDiv');">

        Looks like you are missing the closing single quote on your string literal "Content on this page...". Also there should be a semicolon after disptime() rather than a comma


        I know the language. I've read a book. - _Madmatt

        N Offline
        N Offline
        NeverHeardOfMe
        wrote on last edited by
        #3

        Surely: onLoad="disptime();MM_CheckFlashVersion ...etc instead of: onLoad="disptime()";"MM_CheckFlashVersion ...etc

        N 1 Reply Last reply
        0
        • N NeverHeardOfMe

          Surely: onLoad="disptime();MM_CheckFlashVersion ...etc instead of: onLoad="disptime()";"MM_CheckFlashVersion ...etc

          N Offline
          N Offline
          Not Active
          wrote on last edited by
          #4

          Right, I missed removing the quotes. Error propagation by copy & paste


          I know the language. I've read a book. - _Madmatt

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups