Skip to main content

Bug Tracker

Side navigation

#8085 closed bug (wontfix)

Opened January 28, 2011 05:30PM UTC

Closed January 28, 2011 06:42PM UTC

Last modified January 28, 2011 07:47PM UTC

Chrome and Safari updating elements that don't match selector, on browser back

Reported by: ghollins@gmail.com 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:

http://jsfiddle.net/eGutT/6/

Here are more details:

http://stackoverflow.com/questions/4823457/jquery-finding-wrong-elements-under-chrome

Attachments (0)
Change History (5)

Changed January 28, 2011 05:41PM UTC by Galen Hollins <ghollins@gmail.com> comment:1

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...

Changed January 28, 2011 06:18PM UTC by Galen Hollins <ghollins@gmail.com> comment:2

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:

http://jsfiddle.net/eGutT/12/

Changed January 28, 2011 06:38PM UTC by petersendidit comment:3

_comment0: The problem is that your input's no 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 them in, and not guessing correctly. \ \ 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.1296239949999515
_comment1: 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 them in, and not guessing correctly. \ \ 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.1296239982300561

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.

Changed January 28, 2011 06:42PM UTC by rwaldron comment:4

component: unfiledattributes
priority: undecidedlow
resolution: → wontfix
status: newclosed

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/

Changed January 28, 2011 07:47PM UTC by Galen Hollins <ghollins@gmail.com> comment:5

Replying to [comment:4 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