I need to insert some javascript code before the close of the BODY tag (). How do I go about this?

Options
I simply need to put some JS code before the closing body tag.



How do I do this? I see no clear way to do so.
Tagged:

Comments

  • Hey Tony,



    The unformatted text part is what we'd use for this. We put the code into that part, and there are options there for where you want the code to load in relation to the head and body tags.



    Thanks!


    Karen
  • When they say this they usually mean put it near the end tag rather than it being necessary to put it right at the end. You put it there so the rest of the page loads before the script executes otherwise it might slow the appearance of the bulk of the page.



    In any case, to add it there you should go to your layouts and add a content placeholder right at the end of your template. Then when editing the page in question insert a new Unformatted Text part (I assume it is JavaScript you are adding) into this area with the code you want to add. Rembmer if it is JavaScript it must have the scriptscript tags around it...
  • Thanks guys... but I'm not familiar enough with this editing environment for this to make much sense.



    I'm making the assumption that I can put this in a template (though I don't know how) and it appear on all pages that use the template.



    I have crated the part, but cannot figure out how to get it below the page content, nor do I know how to determine what template a specific page uses.
  • Karen Badham:
    Hey Tony,



    The unformatted text part is what we'd use for this. We put the code into that part, and there are options there for where you want the code to load in relation to the head and body tags.



    Thanks!


    Karen
    Thanks! Where are the options to have it appear after the page content?
  • Karen Badham:
    Hey Tony,



    The unformatted text part is what we'd use for this. We put the code into that part, and there are options there for where you want the code to load in relation to the head and body tags.



    Thanks!


    Karen
    I found it! The advanced options are hidden and I didn't see them at first.



    Thanks a lot!
  • I found the Advanced options for the part's properties, and it now appears where I'd expect it to.



    Thanks for all your help!
  • Karen had the simpler approach!! Ignore me...

Categories