We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 27330
    • 884 Posts
    I have <body onload="preloadImages();"> in my template for rollover buttons.
    On several pages I need to add additional onload event and was thinking if there is a way to make a TV for the <body onload> tag with defaults of "preloadImages()". this will allow me to add events on the doc level.

    Is that possible? if yes can you tell the TV settings because my tries giving me blank page with source missing the <body> altogether....
    any tips? huh
      • 33337
      • 3,975 Posts
      Add a simple TV, choose type Text, then reference in template like:

      <body onload="[*onloadTv*]">

      (in this case I have TV named onloadTv).

      OR if some documents dont have onload altogether, use something like this:

      <body [*onloadTv*]>

      while add a onload="preloadImages();" in tv content
        Zaigham R - MODX Professional | Skype | Email | Twitter

        Digging the interwebs for #MODX gems and bringing it to you. modx.link
        • 27330
        • 884 Posts
        Muchos gracias Zi!
        I tried all the other possibilities smiley
        works like a charm.