#8085 closed bug (wontfix)
Chrome and Safari updating elements that don't match selector, on browser back
Reported by: | Owned by: | ||
---|---|---|---|
Priority: | low | Milestone: | 1.next |
Component: | attributes | Version: | 1.4.4 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
When coming back to a page via the browser back button under Chrome/Safari, some elements get wrong values. Please see the following simplified example:
Here are more details: http://stackoverflow.com/questions/4823457/jquery-finding-wrong-elements-under-chrome
Change History (5)
comment:1 Changed 12 years ago by
comment:2 Changed 12 years ago by
Sorry for modifying the example again, but this example more clearly shows that the weird form population only occurs when jQuery .val() methods are introduced. In the example, try commenting/uncommenting the
updateRowNums();
line of code:
comment:3 Changed 12 years ago by
The problem is that your input's do not have a name attribute. Chrome/Safari seems to try to save what you entered in to form fields when you go forward and back in the history. Because your inputs do not have name attributes its guessing which input field to put the values back in, and is guessing incorrectly.
Add name attributes to your fields and its all fixed: http://jsfiddle.net/petersendidit/eGutT/14/
Chrome/Safari probably should be checking for the id attribute of the name attribute is missing.
comment:4 follow-up: 5 Changed 12 years ago by
Component: | unfiled → attributes |
---|---|
Priority: | undecided → low |
Resolution: | → wontfix |
Status: | new → closed |
I'm seeing this too, but it's not a jQuery bug by any means. This test: http://jsfiddle.net/rwaldron/UvmDv/7/ doesn't use jQuery and has the same behaviour.
I would suggest filing this here: https://bugs.webkit.org/
comment:5 Changed 12 years ago by
Replying to rwaldron:
I'm seeing this too, but it's not a jQuery bug by any means. This test: http://jsfiddle.net/rwaldron/UvmDv/7/ doesn't use jQuery and has the same behaviour.
I would suggest filing this here: https://bugs.webkit.org/
Thanks! Yes, I agree this looks like a webkit bug. I've filed a bug with webkit. Thanks, Galen
Here is another example, that's even more simplified:
http://jsfiddle.net/eGutT/9/
I'm not sure if this is a Chrome/Safari bug, or a jQuery bug...