Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Using a persistent footer with jQuery 1.8.0 adds Zeros to end of document #4887
When using jQuery 1.8.0, in a site with a persistent footer toolbar containing a navbar, and no persistent header, extra text elements containing zeroes are being added to the end of the DOM whenever the page is changed through the footer navbar. This issue does not exist with jQuery 1.7.2
Persistent footer docs:
I've traced the problem to the file js/widgets/fixedToolbar.js, line 155:
At this point, if there is no persistent header, the variable nextHeader has a value of 0. On line 159,
It could be argued this is a bug with jQuery, but it seems like there might be a line missing which would fix this very easily. We already assign nextFooter to an empty jQ object if it is blank, so we could add the same for nextHeader after line 155:
So the code would look like
Sample page using the jsbin template which uses latest code
Use the footer tabs in the output window to switch pages. Notice zeroes being added to the document. Uncomment the jQuery 1.7.2 script tag in the HTML header and remove the jQuery 1.8.0 script tag. Try the tabs again. The problem no longer occurs.
Steps to reproduce
For more info see the JSBin example above.
The fixed footer should stay in place while the page transitions behind it. Once the transition is complete, the target page should be rendered.
The fixed footer stays in place, and the transition happens, but during the transition, extra text elements are added to the page.
Query Mobile version
This is an odd one. I see the issue in your test page, but not in the latest docs which also use 1.8.0: