SkyRanger Posted May 4, 2007 Share Posted May 4, 2007 I am having a problem with IE reading anchors. I can get it to work in FF but IE7 just doesn't like them. Has anybody else had this problem if so how can I fix it. Link on one page is: link.php?id=4#bottom On the link.php page at the bottom it would have <a name="bottom"> As I said, works no problem in FF but having problems in IE Quote Link to comment Share on other sites More sharing options...
obsidian Posted May 4, 2007 Share Posted May 4, 2007 I personally like to use id instead of name. This way, you can have your #references pointing to any type of element you like (including divs or header tags, too). Quote Link to comment Share on other sites More sharing options...
SkyRanger Posted May 4, 2007 Author Share Posted May 4, 2007 Ok, so instead of using <a name="#bottom">, I would use <div name="#bottom">? Quote Link to comment Share on other sites More sharing options...
obsidian Posted May 4, 2007 Share Posted May 4, 2007 Ok, so instead of using <a name="#bottom">, I would use <div name="#bottom">? No, I recommended using ID instead of NAME: <div id="bottom"></div> Also, you've got to make sure that you're closing out your elements. Quote Link to comment Share on other sites More sharing options...
SkyRanger Posted May 4, 2007 Author Share Posted May 4, 2007 Ok, not sure if it is me or IE Link: /officeview.php?oid=145#bottom code at bottom of page: <div id="bottom"></div> Works no problem with FF but not in IE for some reason. Quote Link to comment Share on other sites More sharing options...
SkyRanger Posted May 4, 2007 Author Share Posted May 4, 2007 After searching the net, there seems to be a problem with IE7 and anchors, not sure how to fix the problem though, anybody have any ideas? Quote Link to comment Share on other sites More sharing options...
SkyRanger Posted May 5, 2007 Author Share Posted May 5, 2007 ~bump~ Quote Link to comment Share on other sites More sharing options...
fenway Posted May 5, 2007 Share Posted May 5, 2007 Seriously? Since when did anchors apply to divs? Quote Link to comment Share on other sites More sharing options...
ToonMariner Posted May 5, 2007 Share Posted May 5, 2007 Seriously? Since when did anchors apply to divs? since for ages! I have not used a named anchor for longer than I can remember. Since there was once a point where the name attribute was marked as deprecated (and recinded I beleive as they forgot how they were gonna tackle radio and option groups) in favour of the id attribute. Name has never been a valid attribute for any tag bar anchor and form elements. Quote Link to comment Share on other sites More sharing options...
SkyRanger Posted May 5, 2007 Author Share Posted May 5, 2007 Yeah, but has anybody got it to work in ie7? Quote Link to comment Share on other sites More sharing options...
ToonMariner Posted May 5, 2007 Share Posted May 5, 2007 yep lol Quote Link to comment Share on other sites More sharing options...
SkyRanger Posted May 5, 2007 Author Share Posted May 5, 2007 would you like to share...lol Quote Link to comment Share on other sites More sharing options...
fenway Posted May 6, 2007 Share Posted May 6, 2007 Seriously? Since when did anchors apply to divs? since for ages! I have not used a named anchor for longer than I can remember. Since there was once a point where the name attribute was marked as deprecated (and recinded I beleive as they forgot how they were gonna tackle radio and option groups) in favour of the id attribute. Name has never been a valid attribute for any tag bar anchor and form elements. Name has always been valid for form elements, since HTML 0.9. Quote Link to comment Share on other sites More sharing options...
ToonMariner Posted May 6, 2007 Share Posted May 6, 2007 Hmmm what you and I percieve as valid are perhaps a little different... Quote Link to comment Share on other sites More sharing options...
SkyRanger Posted May 6, 2007 Author Share Posted May 6, 2007 All i want to know is why: link.php?id=1#bottom is not working for me in ie7 when i use either: echo "<div id=\"bottom\"></div>"; or echo "<a name=\"bottom\"> I also tried on the same page using <a href=\"#bottom\"></a> And that never worked either in IE7 Quote Link to comment Share on other sites More sharing options...
SkyRanger Posted May 7, 2007 Author Share Posted May 7, 2007 bump Quote Link to comment Share on other sites More sharing options...
fenway Posted May 7, 2007 Share Posted May 7, 2007 You need to close it: <A name="bottom"></A> Quote Link to comment Share on other sites More sharing options...
SkyRanger Posted May 7, 2007 Author Share Posted May 7, 2007 No, that didn't do it either, this is really puzzling. Quote Link to comment Share on other sites More sharing options...
SkyRanger Posted May 7, 2007 Author Share Posted May 7, 2007 Ok, checked it in FF, Opera and IE7 and FF IE plugin FF - Works Opera - Works IE7 - Doesn't Work FF IE Plugin - Doesn't work. Quote Link to comment Share on other sites More sharing options...
ToonMariner Posted May 7, 2007 Share Posted May 7, 2007 there must be something a miss.... <div id="bottom"> ... </div> any link ending in #bottom should scroll to that... try it without any other url vars in the link...(get rid of the id=1 bit) Quote Link to comment Share on other sites More sharing options...
fenway Posted May 7, 2007 Share Posted May 7, 2007 Ok, checked it in FF, Opera and IE7 and FF IE plugin FF - Works Opera - Works IE7 - Doesn't Work FF IE Plugin - Doesn't work. I checked a very simple test page in IE7 and it does work. <a href="#anchor">Jump</a> <P>lorem ipsum <P>lorem ipsum <P>lorem ipsum <P>lorem ipsum [ enough to make it scroll ..... ] <a name="anchor"></a> <h3>The Anchor</h3> Quote Link to comment Share on other sites More sharing options...
ToonMariner Posted May 7, 2007 Share Posted May 7, 2007 you don't use # in the href of a named anchor. the hash simply allow the browser to know it shoudl be looking for a bookmark in the page. Quote Link to comment Share on other sites More sharing options...
SkyRanger Posted May 7, 2007 Author Share Posted May 7, 2007 Ok, did a test, got rid of everything, tested the page worked no problem in all browsers Tested with: view.php?oid=146&post_read=1#bottom No such lucky still won't work in IE, anybody have any ideas why? Quote Link to comment Share on other sites More sharing options...
ToonMariner Posted May 7, 2007 Share Posted May 7, 2007 top of you page put print_r($_GET); see if post_read is 1 or 1#bottom... Quote Link to comment Share on other sites More sharing options...
SkyRanger Posted May 8, 2007 Author Share Posted May 8, 2007 Array ( [oid] => 153 [post_read] => 1 ) When I used: view.php?oid=153&post_read=1#bottom Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.