0
Welcome Guest! Login
0 items Join Now

SOLVED - REALLY need help placing javascript on each page

    • Jenn's Avatar
    • Jenn
    • Rocketeer
    • Posts: 63
    • Thanks: 0

    SOLVED - REALLY need help placing javascript on each page

    Posted 13 years 4 weeks ago
    • Hi there - I am in desperate need of help to implement a javascript on each page of a 1.5.26 Joomla install. the site is: www.randshardscaping.com The Gantry version is 3.1.20 on a Panacea template.

      My question is similar to the one above, except for my Joomla version is different. I tried the solution above, but it didn't work. My client wants a javascript installed that will run on each page to dynamically update the phone number in the footer under Contact Us. You don't see a phone number there now because I removed the hard coded version and put in the code for dynamic number - which is there, however the script gave me a php error on the entire site when I followed the instructions above. This is most urgent (as I am sure everyone's questions are :oops: ) but I would really appreciate any help you can give. Please let me know if i can provide you with more info. By the way - entered the script info in index.html, maybe that was my mistake?? Thank you immensely.
    • Last Edit: 13 years 4 weeks ago by Jenn.
    • Cliff Pfeifer's Avatar
    • Cliff Pfeifer
    • Preeminent Rocketeer
    • Posts: 8444
    • Thanks: 20
    • Website Developer

    Re: SOLVED - REALLY need help placing javascript on each page

    Posted 13 years 4 weeks ago
    • Hi, I'm not sure which questions or posts you are referring to, there aren't any links to other threads or questions here. The default way of doing this is to put the script into a js file, place the js file in the js folder of the template directory. Then add this line into the head section of index.php, using the name of your script file of course.
      $gantry->addScript("customscript.js");
      Hope that helps.
    • The difficult we do immediately, the impossible takes a little longer.
    • Jenn's Avatar
    • Jenn
    • Rocketeer
    • Posts: 63
    • Thanks: 0

    Re: SOLVED - REALLY need help placing javascript on each page

    Posted 13 years 4 weeks ago
    • Thank you so much! This tracking code is to dynamically insert phone numbers according to the marketing campaign running at the time. Sincerely appreciate your help!!
    • Cliff Pfeifer's Avatar
    • Cliff Pfeifer
    • Preeminent Rocketeer
    • Posts: 8444
    • Thanks: 20
    • Website Developer

    Re: SOLVED - REALLY need help placing javascript on each page

    Posted 13 years 4 weeks ago
    • Hi, got your message. The scripts themselves have errors in them, that could be why they are not working - I see this in my web inspector. Syntax error in one and undefined variable in the other.

      This image is hidden for guests.
      Please log in or register to see it.


      The scripts are loading fine, but that doesn't appear to be whats causing your issue. I can't offer much help with third party scripts.
    • The difficult we do immediately, the impossible takes a little longer.
    • Jenn's Avatar
    • Jenn
    • Rocketeer
    • Posts: 63
    • Thanks: 0

    Re: SOLVED - REALLY need help placing javascript on each page

    Posted 13 years 4 weeks ago
    • Thank you so much - this is more than helpful. Sorry for the bother! You guys are the best!
    • Cliff Pfeifer's Avatar
    • Cliff Pfeifer
    • Preeminent Rocketeer
    • Posts: 8444
    • Thanks: 20
    • Website Developer

    Re: SOLVED - REALLY need help placing javascript on each page

    Posted 13 years 3 weeks ago
    • Hi, no problem, Javascript has it's own set of challenges. :D
    • The difficult we do immediately, the impossible takes a little longer.
    • Jenn's Avatar
    • Jenn
    • Rocketeer
    • Posts: 63
    • Thanks: 0

    Re: SOLVED - REALLY need help placing javascript on each page

    Posted 13 years 3 weeks ago
    • As do I! :cheesy:

Time to create page: 0.057 seconds