ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Using Outside JS/CSS

December 29, 2011 9:53am

Subscribe [4]
  • #1 / Dec 29, 2011 9:53am

    nyc

    66 posts

    I’m still in the beginning stages of setting up my file structure but I was wondering how do I set up my EE so I can use CS/JS from the FTP instead of template files?

  • #2 / Dec 29, 2011 11:26am

    Boyink!

    5011 posts

    Link to it like you normally would.

  • #3 / Dec 29, 2011 11:27am

    Rob Allen

    3114 posts

    First create a folder where your .js files will live, something like /assets/js and upload the files there.

    Then wherever you need to call the JS files in your templates, such as between the <head> and </head> tags just output the javascript tags normally.

    <head>
    <title>My page</title>
    < script src="/assets/js/file.js" >< /script >
    </head>
  • #4 / Dec 30, 2011 4:47pm

    nyc

    66 posts

    Thats how I have it set up now but I guess I was wondering if there was more of an EE way to do things.. thanks to you both

  • #5 / Jan 07, 2012 10:48am

    kaizendc

    16 posts

    I’m having the same problem too, my JS codes are not working,

    my normal folder strucure is

    js/jscode.js
    css/csscode.css

    where should I create a folder to make my code work?

    Thanks

  • #6 / Jan 07, 2012 10:52am

    Boyink!

    5011 posts

    You can put js anywhere on the site - you just need to make sure EE can always see the correct path to it.  If it’s not working look at the paths of the rendered code to see if they are right.

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases