2 Replies Latest reply on Aug 8, 2007 10:06 AM by saigon_man

    how to stick an onload javascript function in body tag?

    saigon_man

      Hello,
      I wonder is there a way to stick a javascript function using onload in body tag? For example:
      Is it possible to set this from within any xml file in my war project without modifying any file from jboss portal codes?

      Thanks,

      TL

        • 1. Re: how to stick an onload javascript function in body tag?
          claprun

           

          "saigon_man" wrote:

          I wonder is there a way to stick a javascript function using onload in body tag? For example:
          <body id="body" onload="myfunction()">

          Is it possible to set this from within any xml file in my war project without modifying any file from jboss portal codes?

          No, and it's not advisable to do so as any portlet refresh would trigger a page refresh which would in turn trigger your javascript function. It would make more sense in the context of partial portlet refresh. Could you provide more details on your use case?

          • 2. Re: how to stick an onload javascript function in body tag?
            saigon_man

            I have a initialize function that would initialize DWR setting (I only need to initialize this once). The best way I can find is to find out how to insert that function in the body when the page loads. What do you suggest which is the best way to do this?

            Thanks,
            TL