1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Adding Custom javascript file (or functions)

Discussion in 'XenForo Questions and Support' started by middlewingnut, Oct 10, 2012.

  1. middlewingnut

    middlewingnut Member

    Hi all,

    So my brand new XF installation is going great. I love it. Unfortunately (for me) I really need to have some dynamic content in a page node. This page is to become the main homepage when people get to the site.

    I appreciate that php includes or content are not an option within the html of a page node, and I'm trying really hard to avoid my usual horrible hack escapades.

    SO, I have got an ajax function that will call up a php script and insert the code returned into a target div, which is coded into the static page node html.

    My question is, how do I get a template to load a new .js file with my functions in - or rather how do I do it neatly. For testing purposes, I've bundled my custom javascript functions in with the jquery.js file.

    Apologies to all if I've posted this in the wrong place or offended anyone with my approach - I'm on a mission!
     
  2. middlewingnut

    middlewingnut Member

    Found an answer: I've added the line below to my template (I used the navigation block, but I don't think it matters where this goes in).

     
    Sway likes this.

Share This Page