[thelist] CF: Tag to insert into body tag

Joshua OIson joshua at alphashop.net
Mon Mar 19 02:03:31 CST 2001


It seems that what you are asking is if there is a way to change

<body>

into

<body onload="myfunction">

based on criteria that are calculated farther down the page.

There is no real simple way to do that.  You may end up trying the
following,

<cfhtmlhead text="
  <script language=""javascript"" for=""body.onload"">
  ... code goes here...
  </script>
">

or

<cfhtmlhead text="
  <script language=""javascript"">
    window.attachEvent('onload', myfunction);
  </script>
">

There maybe HTML/JS version limitations to these techniques, but it may get
you to where you need to go.

HTH

-joshua

You wrote:

Is anyone aware of a tag that will allow me to insert attributes into
the <body> tag of a document in a similar way to <cfhtmlhead>? I use
templates for my HTML, some documents use validation javascript
other's not, and I prefer not to leave an OnLoad() in the body if
it's not going to be used.






More information about the thelist mailing list