IE is not jumping to hash #someanchor in URL

E

Erwin Moller

Hi group,

I found that IE6 sometimes doesn't jump to an anchortag in the URL.
I have an URL like:
http://localhost/bla/test.php?userid=1#edituser

In the html produced i have an anchortag halfway my page:
<a name="edituser" id="edituser"><br></a>

The id I added to test, but that didn't help anything.

AFAIK: this is the usual way to make a page jump to a certain point.
I also disabled some JS-alerts, but that didn't help either.

In Mozilla it works (as expected).

Does anybody know a solution or a place for me to read on?

TIA!

Regards,
Erwin Moller
 
E

Erwin Moller

brucie said:
<a href="#edituser">link</a>

<p id="edituser">target</p>

Hi Brucie

Yes yes, I am no noob. ;-)
I know that.

I was talking about a URL I create that includes the #blabla at the end.
THAT one is not working.

Any ideas?

Regards,
Erwin Molller
 
B

brucie

I SHOULD, but that isn't working on my setup.
(IE6, W2000, both suck, i know, but that is my customers targetplatform)

do it the old fashioned way, not use an id.

<a name="edituser">blah</a>
 
E

Erwin Moller

brucie said:
do it the old fashioned way, not use an id.

<a name="edituser">blah</a>


Really Brucie, I tried them all.
IE6 just refuses to jump to the right place.

I first had the anchortag in a table.
I took it out to a boring spot. No succes.

I changed name to id. No succes.
I tried them both (id and name): No succes.

I took out all name/value pairs in the URL: No succes.

This looks like a bug to me. :-(

Regards,
Erwin Moller
 
D

Dylan Parry

Trapped in the departure lounge at alt.html, Erwin Moller got bored and
wrote:
I SHOULD, but that isn't working on my setup.

How about showing us a URL so we don't have to get our crystal balls
out?
 
E

Els

Erwin said:
Really Brucie, I tried them all.
IE6 just refuses to jump to the right place.

I first had the anchortag in a table.
I took it out to a boring spot. No succes.

I changed name to id. No succes.
I tried them both (id and name): No succes.

I took out all name/value pairs in the URL: No succes.

This looks like a bug to me. :-(

I think it's just because of the querystring in the url
"?userid=1#edituser"
It probably parses literally, as in userid is "1#edituser".
Maybe your script can be changed to do something with that? (no idea
really)
 
E

Erwin Moller

Dylan said:
Trapped in the departure lounge at alt.html, Erwin Moller got bored and
wrote:


How about showing us a URL so we don't have to get our crystal balls
out?

Hi,

Yeah, that would be the easiest, but I cannot.
Project with nondisclosure etc. etc.
The part where it happens is deep into some Admin-part of the app, and I
cannot give you entry there.
(I hate secrets, but I have to make a living.)

Getting it out there and publish it alone, would be a lot of work, since I
have to mimic a lot of stuff, including the database and a huge table.

Good But I found out that if I place the <a name="edituser"><br></a> in an other
spot, the bug disappers.

So it is kind of 'solved', except for the bad taste it leaves. :p

Thanks you both (Brucie too) for your time and patience with this obscure
problem.

Regards,
Erwin Moller
 
E

Erwin Moller

Els said:
I think it's just because of the querystring in the url
"?userid=1#edituser"
It probably parses literally, as in userid is "1#edituser".
Maybe your script can be changed to do something with that? (no idea
really)

Well, that was my though too, but I do it like this for ages, and it is also
the official way to do it.
It always worked on all browsers and platforms.

Except now on IE6/W2000, and to make things worse, if I move the <a
name="edituser"> to another spot in the HTML, it works!

So I 'solved' the problem.

I am sure this must be (yet another) bug in IE6.

Personally I would like to target only internetbrowsers, but the company I
develop this app for thinks IE6 is a browser too.
;-)


Anyway, I can work on now, and learned this:
If an #bla is not working in IE, just move the anchortag to another spot in
the code.

Thanks for your time and patience with this abscure bug.

Regards,
Erwin Moller
 
J

Jonathan N. Little

Erwin Moller wrote:
Well, that was my though too, but I do it like this for ages, and it is also
the official way to do it.
It always worked on all browsers and platforms.

Except now on IE6/W2000, and to make things worse, if I move the <a
name="edituser"> to another spot in the HTML, it works!

So I 'solved' the problem.

I am sure this must be (yet another) bug in IE6.

No, I bet it is your code, if we could stop this silly round-robin and
see the offending URL, huh? I say this because I am almost finished
converting my site to PHP (maybe by this weekend hooray) and generate
urls with query strings with hashes and have tested with MSIE on Windows
2000 with no problem.

You have made a mistake.
Personally I would like to target only internetbrowsers, but the company I
develop this app for thinks IE6 is a browser too.
;-)

Can be done, I dislike IE and only use for testing, but my only
frustration with the browser is with CSS and styling, not the markup. IE
is like an old Chevy, it won't look pretty but you can though the worst
crap at it and it keeps on running.
Anyway, I can work on now, and learned this:
If an #bla is not working in IE, just move the anchortag to another spot in
the code.
 
E

Erwin Moller

Jonathan said:
Erwin Moller wrote:


No, I bet it is your code,


Excuse me?
Well, you sound awefully convinced for a guy that didn't see 1 line of
actual code.
Why are you so sure about it?


if we could stop this silly round-robin and
see the offending URL, huh?

If you read this thread, you could have noticed I am not allowed to let
strangers into this project: non-disclosure stuff.
Sorry about that.
I don't like it either.
And cutting the page out of its context to present it to you all is not
possible, because this (bug I think) only happens when the page is builded
the first time.
If I reload it does follow the #blabla.

So I have to let you in the project, and the place where the problem arrises
is deep into some admin-part, where nobody is welcome. :-(



I say this because I am almost finished
converting my site to PHP (maybe by this weekend hooray) and generate
urls with query strings with hashes and have tested with MSIE on Windows
2000 with no problem.

Well good for you.
My site is in php too.
But php have nothing to do with this.
This is IE.

You have made a mistake.

Again: Why are you so sure about that without seeing 1 line?
Because it works on your setup?
Does that mean that it works everywhere?

FYI: I am not new to the game: I have over 20 years of
programmingexperience, made a zillion database driven websites, and write
html with the same ease as I speak. I mastered many languages.
I do not want to brag how great I am, I just want to make clear to you I
have seen my share of bugs, and get a little irritated by your
overconfident claim that I made a mistake.
Do you have any idea how much update and bugfixes IE had over the last 5
years?
You should not claim I made a mistake without knowledge (actual html): it is
ignorant and honestly: stupid. It irritates me (you noticed). ;-)

Can be done, I dislike IE and only use for testing, but my only
frustration with the browser is with CSS and styling, not the markup. IE
is like an old Chevy, it won't look pretty but you can though the worst
crap at it and it keeps on running.

IE keeps running?
When it don't crash it renders something most of the time. True.
Seriously: I haven't seen much worse crap than that piece from M$.
Maybe Outlook/exchange are worse. not sure...

Anyway, I do not want to start a fight here.
Thanks for your response.

Regards,
Erwin Moller
 
D

Dylan Parry

Trapped in the departure lounge at alt.html, Jonathan N. Little got
bored said:
No, I bet it is your code

Not necessarily. How big is the offending page? It might be that IE is
attempting to jump to the location before the page has finished loads;
finding that the specified location doesn't exist, and then sitting at
the top of the page like an eejit :\
 
E

Erwin Moller

Dylan said:
Trapped in the departure lounge at alt.html, Jonathan N. Little got


Not necessarily. How big is the offending page? It might be that IE is
attempting to jump to the location before the page has finished loads;
finding that the specified location doesn't exist, and then sitting at
the top of the page like an eejit :\

Hi Dylan,

What you describe seems very close to my situation. :)
The page is rather big and the anchor is placed excactly before a rather big
table.
I noticed that if I place the anchor INSIDE the table, things work as
expected.
If I place it BEFORE the table, it is not working.

It looks like IE want to jump to the right location, but it did not finish
loading the page, the somehow 'forgets' to make the jump.

Another thing I noticed: If I enable output buffering, all works as it
should.

// start of script:
ob_start();

// script

ob_end_flush();


Rather curious. :-/

Anyway, I can work around the issue by using output buffering.

Thanks for your response!

Regards,
Erwin Moller
 
J

Jonathan N. Little

Erwin said:
Jonathan N. Little wrote:





Excuse me?
Well, you sound awefully convinced for a guy that didn't see 1 line of
actual code.
Why are you so sure about it?

1) MSIE has recognize hashes even from IDs version 4+, NN4x would only
on named A elements

2) Without example code, yes it's wild guesses, the number of times in
this NG we hear 'Help but cannot supply code because...' Can you not
duplicate the problem in a sample without confidential content for
debugging?

3) You where the one who brought up the issue of query string with hash
as possible cause:
I think it's just because of the querystring in the url

so my mention of coding in PHP was that I have generated urls with query
strings with hashes with not problems with said browser...in tables,
div's, p's.

4) One possible cause more than one instance of 'id' on the page.

5) Overlooked markup errors, IE is less likely to complain but try to
'guess' the authors intension guess incorrectly and foul up something
along the way, another pair if eyes are great for finding these errors
if we could stop this silly round-robin and



If you read this thread, you could have noticed I am not allowed to let
strangers into this project: non-disclosure stuff.
Sorry about that.
I don't like it either.
And cutting the page out of its context to present it to you all is not
possible, because this (bug I think) only happens when the page is builded
the first time.
If I reload it does follow the #blabla.

So I have to let you in the project, and the place where the problem arrises
is deep into some admin-part, where nobody is welcome. :-(



I say this because I am almost finished



Well good for you.
My site is in php too.
But php have nothing to do with this.
This is IE.

With a mix of markup and markup inserted by script, the likelihood of a
markup errors greater. PHP & ASP where you can inject here and there it
is easy for an error to occur, that was my point where PHP could be the
problem....
Again: Why are you so sure about that without seeing 1 line?
Because it works on your setup?
Does that mean that it works everywhere?

FYI: I am not new to the game: I have over 20 years of
programmingexperience, made a zillion database driven websites, and write
html with the same ease as I speak. I mastered many languages.
I do not want to brag how great I am, I just want to make clear to you I
have seen my share of bugs, and get a little irritated by your
overconfident claim that I made a mistake.
Do you have any idea how much update and bugfixes IE had over the last 5
years?
You should not claim I made a mistake without knowledge (actual html): it is
ignorant and honestly: stupid. It irritates me (you noticed). ;-)

Again, not challenging your skills, just pointing out more likely source
of your problem and how not having something to look at hampers the
situation.
IE keeps running?
When it don't crash it renders something most of the time. True.
Seriously: I haven't seen much worse crap than that piece from M$.
Maybe Outlook/exchange are worse. not sure...

No fan of M$ at all, since IE can parse such tag soup debugging can be a
real PITA.

Anyway, I do not want to start a fight here.
Thanks for your response.

Same here, would really like to help.
 
E

Erwin Moller

Jonathan N. Little wrote:

Same here, would really like to help.

Hi Jonathan,

I the other branch of this thread (Dylan Parry) I describe what I think the
problem was.
Dylan's response triggered me into the right direction.

It turn out that IE IS following the hash if I turn output buffering on.
Simple by adding ob_start() the problem is gone.

I found a few other people on the net who advocate output buffering ON with
PHP under IIS for different reasons (most concerned a very slow
userexperience with outputbuffereing off.).

My current workinghypotisis (based on Dylans hunch) is this:
- If IE gets fragmented data in, it 'forgets' to jump.

My former setup was excactly doing that:
1) An URL with a hash
2) Building the HTML page bit by bit including a rather long table that
takes some time to get in (a 2 second query).

Well, output-buffering is really easy to turn on, and all the problems are
gone, so I am happy enough now to enter the weekend with a smile. :)

Thanks for your time and sorry for my rather irritated tone in my last
response. :)

Regards and have a nice weekend,
Erwin Moller
 
J

Jonathan N. Little

Erwin said:
Jonathan N. Little wrote:




Hi Jonathan,

I the other branch of this thread (Dylan Parry) I describe what I think the
problem was.
Dylan's response triggered me into the right direction.

It turn out that IE IS following the hash if I turn output buffering on.
Simple by adding ob_start() the problem is gone.

I found a few other people on the net who advocate output buffering ON with
PHP under IIS for different reasons (most concerned a very slow
userexperience with outputbuffereing off.).

My current workinghypotisis (based on Dylans hunch) is this:
- If IE gets fragmented data in, it 'forgets' to jump.

Sounds plausible, IE is not the only browser that can get confused when
data comes in dribs and drabs.
My former setup was excactly doing that:
1) An URL with a hash
2) Building the HTML page bit by bit including a rather long table that
takes some time to get in (a 2 second query).

What if you presented a temp 'loading' page as you build up the final a
page? Can be done in Perl, should be in PHP too, I'm just new to PHP.
Well, output-buffering is really easy to turn on, and all the problems are
gone, so I am happy enough now to enter the weekend with a smile. :)

Thanks for your time and sorry for my rather irritated tone in my last
response. :)

No problem-o I full understand how frustrating debugging can be! But you
cannot imagine how many times in the NG there is a call for help with no
code. Some do like to tweak but many want to help.

ob_start() works then call it a week, grab a cold one and forget about
it 'til Monday!
 
T

Toby Inkster

Els said:
I think it's just because of the querystring in the url
"?userid=1#edituser"
It probably parses literally, as in userid is "1#edituser".

No -- the server never sees the "#edituser" part -- the browser doesn't
pass it to the server.
 
T

Toby Inkster

Erwin said:
I noticed that if I place the anchor INSIDE the table, things work as
expected. If I place it BEFORE the table, it is not working.

It looks like IE want to jump to the right location, but it did not finish
loading the page, the somehow 'forgets' to make the jump.

Another thing I noticed: If I enable output buffering, all works as it
should.

Let me guess -- the table contains lots of data pulled from some external
source (e.g. an SQL database). This means that the page is sent to the
browser a tiny bit at a time, while the data is slowly loaded from the
external source.

This causes the forgetting that you talk about.

By buffering the output, you create the entire page and then shove it to
the browser in one big push. IE doesn't have time to "forget".

I've seen something similar before, but never cared enough to fix it. It's
an inexact science and will probably vary on a day-to-day or hour-to-hour
basis, depending on how much strain your external data source is under.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,444
Messages
2,571,709
Members
48,796
Latest member
Greg L.
Top