Adding java messes up my links...Can you help?

kygardenkygarden Registered Users Posts: 1,060 Major grins
edited October 4, 2011 in SmugMug Support
Hi,

For my http://www.openbloom.com/ site, if I try to add some java to the 'Bottom Javascript' section, it messes up my Galleries link at the top of the page. I guess it messes up all the links up there like Home, Galleries, About Me. I was going to play around with some Google ads at the bottom of my page to see what it looked like, but as soon as I add it, my links at the top of the page get broken. When I click on Galleries, it goes right back to the home page for example.

There's already some java in this section and I assume somehow the addition of the Google ad java is not playing well with it. Someone in the past helped me create the links at the top of my page so I'm not very familiar with what this script does. I'd like to keep everything as is, but just add the small google ad at the bottom. I may not like the ads there, but I want to at least try it for a bit.

Here's what's already in the Bottom Javascript section (someone helped me with this in the past):

function hasPath(sPath)
{
re = new RegExp("\/" + sPath + "(\/|$)");
return re.test(window.location)
}

if (hasPath("galleries"))
YD.addClass(document.body, "galleries");


Any ideas on how to add the new Google ad javascript without breaking anything?

Thanks!

Comments

  • rainforest1155rainforest1155 Registered Users Posts: 4,566 Major grins
    edited October 4, 2011
    What specific code do you try to add? Are you sure it's pure javascript code? If there are any html tags in it, like tags, it's not pure javascript code and doesn't belong into the javascript section. It would then go into the custom footer section.

    Sebastian
    Sebastian
    SmugMug Support Hero
  • kygardenkygarden Registered Users Posts: 1,060 Major grins
    edited October 4, 2011
    It's the code you get when you go into your AdSense Google page and click 'Get Code' that you copy and paste into your web site. It does indeed start with:

    So, how would I deal with this? I tried to add it to my Custom Footer in the past but it didn't seem to have any affect. I didn't see the google ad at the bottom.
  • kygardenkygarden Registered Users Posts: 1,060 Major grins
    edited October 4, 2011
    Ok wait....I tried it again in the custom footer and I see it now. Can you help me get it centered? I think I can figure that out though....but if you have the code off the top of your head and can tell me right away, that would be awesome. Thanks for your help!
  • rainforest1155rainforest1155 Registered Users Posts: 4,566 Major grins
    edited October 4, 2011
    That's html code and it belongs in either in the custom header or custom footer section depending on where you'd like the ads to show.

    I suggest that you add the code and then write back so we could see what may be the issue.

    For future customization questions, they're best posted on the customization forum:
    http://www.dgrin.com/forumdisplay.php?f=31
    Sebastian
    SmugMug Support Hero
  • kygardenkygarden Registered Users Posts: 1,060 Major grins
    edited October 4, 2011
    Thanks Sebastian. I got it figured out. It's aligned properly too with:

  • rainforest1155rainforest1155 Registered Users Posts: 4,566 Major grins
    edited October 4, 2011
    That's great to hear! :)

    Have a good day.

    Sebastian
    Sebastian
    SmugMug Support Hero
  • rainforest1155rainforest1155 Registered Users Posts: 4,566 Major grins
    edited October 4, 2011
    One thing I noticed: you don't seem to have closed the

    tag you opened with the closing

    tag. Please make sure to close all tags you open properly to prevent site issues.
    Sebastian
    SmugMug Support Hero
  • kygardenkygarden Registered Users Posts: 1,060 Major grins
    edited October 4, 2011
  • mbradymbrady Registered Users Posts: 321 Major grins
    edited October 4, 2011
    Just a pet peeve: Java and Javascript are not the same thing.
Sign In or Register to comment.