Home link with a custom header
Hi there,
I used this code from the help section to change the 'home' link to point towards my homepage rather than the smugmug homepage, yet I cannot seem to get it to work.
// Change Home Link (from Devbobo)
YE.onContentReady('toolbar', function () { this.innerHTML = this.innerHTML.replace(/href="http:\/\/www.smugmug.com\/([?\w&;=]+)?"/, 'href="' + webServer + '"')});
I have trawled through the support and I cant quite figure out why this is the case. Does the fact I have a custom header that replaces the original smugmug logo cause this issue?
Any help would be greatly Appreciated,
Thanks!
www.nevilleporter.com
I used this code from the help section to change the 'home' link to point towards my homepage rather than the smugmug homepage, yet I cannot seem to get it to work.
// Change Home Link (from Devbobo)
YE.onContentReady('toolbar', function () { this.innerHTML = this.innerHTML.replace(/href="http:\/\/www.smugmug.com\/([?\w&;=]+)?"/, 'href="' + webServer + '"')});
I have trawled through the support and I cant quite figure out why this is the case. Does the fact I have a custom header that replaces the original smugmug logo cause this issue?
Any help would be greatly Appreciated,
Thanks!

www.nevilleporter.com
0
Comments
Homepage • Popular
JFriend's javascript customizations • Secrets for getting fast answers on Dgrin
Always include a link to your site when posting a question
Try this code instead:
Homepage • Popular
JFriend's javascript customizations • Secrets for getting fast answers on Dgrin
Always include a link to your site when posting a question
YE.onContentReady('toolbar', function () { this.innerHTML = this.innerHTML.replace(/href="http:\/\/www.smugmug.com([?\/\w&;=\-]+)?"/, 'href="' + webServer + '"')});
SmugMug API Developer
My Photos
umm, why won't it work in IE ?
SmugMug API Developer
My Photos
Thankyou so much for your help!
Here's why I do this stuff a different way now. I've found that the innerHTML in IE sometimes does not have quote marks around attributes even though the original source does. I haven't figured out when IE strips them out and when not, but I've made a mental note not to count on them being there. For example CSS class names on a tag don't seem to have quotes around them in the innerHTML even though they do in the source.
In this particular case, it looks like IE does have quote marks around the link URL in innerHTML, but there are other attributes where it strips them off.
But, for that reason, I stopped trying to match innerHTML whenever possible and prefer to address the attribute directly in JS which is more consistent across browsers.
There are also more and more places in the Smugmug pages where setting some innerHTML that also includes flash things or YUI buttons will mess them up such that they no longer work (like setting innerHTML on the breadcrumb object will mess up the slideshow button). So, I try to avoid setting the innerHTML variable whenever I can accomplish what I want by modifying an attribute directly. It also just feels cleaner to me since I'm not resetting a whole bunch of other HTML that I don't even intend to change.
Homepage • Popular
JFriend's javascript customizations • Secrets for getting fast answers on Dgrin
Always include a link to your site when posting a question
Thank you guys....I also tried the first one and nothing...now I am confuse. Which code and where? to direct the Home link to my website? I would really appreciate the help.