Welcome to WebmasterWorld Guest from 54.226.242.132

Forum Moderators: incrediBILL

Message Too Old, No Replies

Inserting anchor not working in ff/safari

anchor text doesnt work, firefox safari

     
12:07 am on Sep 28, 2010 (gmt 0)

New User

5+ Year Member

joined:Oct 28, 2009
posts: 8
votes: 0


Hello,
So this is a question I have seen written a thousand times but I cannot find a solution, hoping someone has one :)

I have a shopping cart and i would like to jump from the top to the bottom when more colorways exist for each product. It works in IE and Chrome and does not work in Firefox and Safari, can anyone tell me what I am doing wrong or how to correct it?


<a href="#morecol" class="button" style="color:#FFFFFF;" >More Colors</a> 


and it should jump to:

<a name="morecol">&nbsp;</a>
<div class="ProductSubtitle" style="padding:10px; margin-top:10px;">
<h3 id="morecol">{$msg.product.secondary_images}</h3>
</div>


The problem is, as the content is dynamic, I cannot add the page in href,I only specify with #. Just need it to find it's anchor down the page. For example (not sure if i can have links in post,I will write like this):

The link should be:
mysite.com/cart/jewelry/123adb#morecol

in ff/safari, with the above code, the link goes to
mysite.com/#morecol

Thank you!
3:56 am on Sept 28, 2010 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:Feb 12, 2003
posts:1199
votes: 0


Your code works fine for me in Firefox and Safari. I click the link, and it jumps down to the anchor. (I did add a 2000-pixel high paragraph after the link in order to give it something to jump to.
4:56 pm on Sept 28, 2010 (gmt 0)

New User

5+ Year Member

joined:Oct 28, 2009
posts: 8
votes: 0


Thanks for the reply!

Did what you suggested adding the following (was that what you meant?)
<a href="#morecol" class="button" style="color:#FFFFFF;" >More Colors</a> <p style="height:2000px;"></p>


Can you tell me if it works for you on the real site cuz still not working for me :( (since removed the paragraph height)

< link removed at member request >

click on "more colors" grey button and should drop you to the bottom of the page.

link should take you to same page and #morecol but in safari/ff goes to home page and #morecol because I believe of the dynamic content- how to get these browsers to understand it is on the same page?

[edited by: tedster at 5:22 pm (utc) on Sep 29, 2010]

5:56 pm on Sept 28, 2010 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:Feb 12, 2003
posts: 1199
votes: 0


Ah, here's your problem:

<base href="http://shoppingforachange.org/"/>


That tells the browser to start all urls with that address.

In fact, your code has two "base href" declarations, one good and one bad. Take out the bad one and you're fine.

Sometimes being able to see the actual page (and the whole code) really helps. However, that's actually not allowed here on WebmasterWorld, so just a heads up that a mod will remove links you post and ask you not to do that any more.
5:58 pm on Sept 28, 2010 (gmt 0)

Senior Member

WebmasterWorld Senior Member tedster is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:May 26, 2000
posts:37301
votes: 0


You've got a number of nesting errors in the mark-up, and these might well be causing confusion. Validate before you try to debug, or you may be infinitely frustrated.
11:47 am on Sept 29, 2010 (gmt 0)

New User

5+ Year Member

joined:Nov 15, 2008
posts:4
votes: 0


I agree with Michael there is problem with "base href"...try to recheck the whole website code...
4:04 pm on Sept 29, 2010 (gmt 0)

Senior Member

WebmasterWorld Senior Member tedster is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:May 26, 2000
posts:37301
votes: 0


Sometimes being able to see the actual page (and the whole code) really helps. However, that's actually not allowed here on WebmasterWorld

I'm willing to experiment with allowing the links in this case. It seems to be strange enough that visiting the page may be needed to debug. Just a warning - this thread may begin to compete with your own URLs in the rankings ;(
5:18 pm on Sept 29, 2010 (gmt 0)

New User

5+ Year Member

joined:Oct 28, 2009
posts: 8
votes: 0


Thanks so much everyone for your replies- helping me out a lot here! Tedster, thank you for allowing me to post the links, now that I am on path to eliminate the issue, can you remove the links? I tried but too much time has past to edit the post now.

The site has only been live for 1 week and since google has only indexed a handful of pages, it doesnt need this one up there with its few pages indexed!

Thanks again everyone!
10:27 pm on Sept 29, 2010 (gmt 0)

Senior Member

WebmasterWorld Senior Member rocknbil is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:Nov 28, 2004
posts:7999
votes: 0


Name is deprecated for anything but form controls, you could try using an id instead. May not make a difference, but it's the right way, and might even work.

<a id="morecol"></a>
10:30 pm on Sept 29, 2010 (gmt 0)

Senior Member

WebmasterWorld Senior Member tedster is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:May 26, 2000
posts:37301
votes: 0


The original code in the first post does have both, name= and <h3 id="morecol">
12:19 am on Oct 1, 2010 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:Feb 12, 2003
posts: 1199
votes: 0


Everyone, I noted the problem long ago: Two conflicting "base href"'s. It's that simple!
12:23 am on Oct 1, 2010 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:Feb 12, 2003
posts: 1199
votes: 0


rocknbil, "name" does *not* appear to be deprecated for anchors, according to W3C [w3.org].
5:07 am on Oct 8, 2010 (gmt 0)

New User

5+ Year Member

joined:Oct 28, 2009
posts: 8
votes: 0


My apologies for taking so long to get to this but everything seems more important than the next when a site goes live-

Just wanted to tell MichaelBluejay and Anuseo that you were absolutely correct, removing the base href did the trick! Anchors work like a charm now. Thank you so very much for your input! You really saved me on that one :)
 

Join The Conversation

Moderators and Top Contributors

Hot Threads This Week

Featured Threads

Free SEO Tools

Hire Expert Members