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.

jQuery use

May 08, 2011 10:05pm

Subscribe [2]
  • #1 / May 08, 2011 10:05pm

    andy_slick

    22 posts

    Hello, I have some jquery in the site I am developing. The functionality of the script works, but it calls for two navigation images through the jquery code. If I link the images in the script like this:

    {site_url}images/interface/prev_btn.png

    they don’t seem to show up on the webpage. Is there something I am doing wrong here?

  • #2 / May 08, 2011 10:10pm

    andy_slick

    22 posts

    Perhaps I should be adding the javascript file to the EE templates. If I were to do this what is the function to link the javascript to the src link in the header include?

  • #3 / May 09, 2011 6:11am

    John Henry Donovan

    12339 posts

    andy_slick,

    Just add your absolute URL to the js script. It won’t pick up the{site_url} variable as it is an external file.

    http://www.mydomain.com/images/interface/prev_btn.png

    Or use a relative link. If your js file was in a folder called scripts

    ../images/interface/prev_btn.png

  • #4 / May 11, 2011 1:00am

    andy_slick

    22 posts

    thanks for that, it works now - will just have to change the link when the site goes live 😉

  • #5 / May 11, 2011 4:05am

    John Henry Donovan

    12339 posts

    Excellent 😊 Feel free to start a new thread if you have any more questions

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

ExpressionEngine News!

#eecms, #events, #releases