Comments (23)
What bugs? I'm interested but need more information.
We already have HTML4 support: https://github.com/defunkt/jquery-pjax/blob/master/jquery.pjax.js#L175-177
β‘
from jquery-pjax.
No worries. They're listed in the readme of History.js, here is the extract:
- History.js solves the following browser bugs:
- HTML5 Browsers
- Chrome 8 sometimes does not contain the correct state data when traversing back to the initial state
- Safari 5, Safari iOS 4 and Firefox 3 and 4 do not fire the
onhashchange
event when the page is loaded with a hash - Safari 5 and Safari iOS 4 do not fire the
onpopstate
event when the hash has changed unlike the other browsers - Safari 5 and Safari iOS 4 fail to return to the correct state once a hash is replaced by a
replaceState
call / bug report - Safari 5 and Safari iOS 4 sometimes fail to apply the state change under busy conditions / bug report
- Google Chrome 8,9,10 and Firefox 4 prior to the RC will always fire
onpopstate
once the page has loaded / change recommendation - Safari iOS 4.0, 4.1, 4.2 have a working HTML5 History API - although the actual back buttons of the browsers do not work, therefore we treat them as HTML4 browsers
- None of the HTML5 browsers actually utilise the
title
argument to thepushState
andreplaceState
calls
- HTML4 Browsers
- Old browsers like MSIE 6,7 and Firefox 2 do not have a
onhashchange
event - MSIE 6 and 7 sometimes do not apply a hash even it was told to (requiring a second call to the apply function)
- Non-Opera HTML4 browsers sometimes do not apply the hash when the hash is not
urlencoded
- Old browsers like MSIE 6,7 and Firefox 2 do not have a
- All Browsers
- State data and titles do not persist once the site is left and then returned (includes page refreshes)
- State titles are never applied to the
document.title
- HTML5 Browsers
:) for the HTML4 support, History.js provides an optional hash fallback which still allows for data and titles (even replaceState) etc. While I agree that hashes aren't ideal, some people do enjoy them - hence why they're optional :)
from jquery-pjax.
Don't know if History.js is the lib of choice, but a crossbrowser (and non html5) fallback would be great for pjax...
from jquery-pjax.
I'm π on this. I'd much rather see a hash in the url than suffer through the slowish page loads. Of course it means you also have to read the hash content on a page load, which is more work than when you just use pushState.
from jquery-pjax.
hi, I've written in the past something similar to pjax, and face this problem
- Old browsers like MSIE 6,7 and Firefox 2 do not have a onhashchange event
The best solution I found is a jquery plugin to provide cross-browser hashchange event (in older browsers it uses polling):
http://benalman.com/projects/jquery-hashchange-plugin/
from jquery-pjax.
We're not going to support browsers without pushState, but feel free to fork and roll your own ;)
from jquery-pjax.
@defunkt this isn't just about browsers without pushState but browsers with pushState. Using History.js will allow you to support Safari and iOS devices as well. Google Chrome will also fire a onpopstate event at the state, where Firefox 4 and Safari don't. Also the data param never persists if the browser session was closed. These are solved with History.js and you don't need to include the history.html4.js for HTML4 support if you don't want to. But if you do, then it will all work find and good too.
from jquery-pjax.
@defunkt, counter-argument? Does GitHub not actually care about the bugs between the browsers which actually do support the HTML5 History API? and/or providing the rich experience to HTML4 users too?
from jquery-pjax.
@balupton, counter-counter-argument: Falling back to URL fragments for HTML4 users breaks the Internet.
They break referrers, they break search engines, they break URL shorteners, they break shared links, and they saddle websites with an enormous amount of technical debt: once you support hash-bang or onhashchange
URLs, you have to include a Javascript hash handler on the root page of your domain forever.
Or at least as long as you want all the old links pointing to your site to work.
π on working around cross-browser issues with HTML5 History API.
π on providing any sort of history support for HTML4 browsers.
from jquery-pjax.
Thanks, and I agree - that is why the hash fallback in history.js is optional (and discouraged) but some users still want that (mostly the ones building closed to the public apps)
from jquery-pjax.
β€οΈ @bobthecow
from jquery-pjax.
okay.... so @defunkt you are for including History.js for working around cross-browser issues with HTML5 History API, and without the HTML4 support?....
from jquery-pjax.
pjax, as a design goal, is for browsers that support pushState. That's the p in pjax. I understand that some people want to target browsers which don't support pushState, but those people don't have to use pjax. Mostly I've been recommending History.js to anyone who wants something outside the scope of pjax, and I will continue doing that in the future.
As for browser bugs, pjax already has some fixes for buggy pushState implementations, and I'd be quite happy to merge/add more as they pop up. β‘ I know there's one pending pull request (#30) with a fix I haven't yet tested and merged.
from jquery-pjax.
@bobthecow is really right. but i needed hash support, i added it. https://github.com/ckald/jquery-pjax/
from jquery-pjax.
@ckald: when I tried to use your merge of hashchange-event and pjax, I got this error in IE9 saying that .pjax is not a method. When I used the regular version of pjax, I did not get the error.
This is how I'm calling pjax (using jquery 1.7.1):
from jquery-pjax.
@DogKnob as I remember, nobody didn't have problems with this. Leave an issue on https://github.com/ckald/jquery-pjax/ with a proof link please to continue discussion
from jquery-pjax.
@ckald: I did manage to get this working somewhat. I no longer get the error, but I'm having IE-specific issues with Wordpress now :(
from jquery-pjax.
@DogKnob Hey, i think defunkt doesn't wants us talking here not about his lib. Personally i won't flood here anymore. https://github.com/ckald/jquery-pjax
from jquery-pjax.
Just as a point of interest. I needed PJAX to work in IE9 specifically, so I simply included this https://github.com/devote/HTML5-History-API in the page. So far seems to be working a treat.
from jquery-pjax.
@kim3er sorry pjax isn't going to target IE9.
from jquery-pjax.
No interest in PJAX adding support for IE9, I believe you're entirely correct not to. My last comment was purely informational for people wanting provide backwards compatibility easily. Rich
from jquery-pjax.
kim3er: no pjax customization was needed? oO
from jquery-pjax.
No customisation, I just added the script in a conditional statement before PJAX.
<!--[if lte IE 9]>
<script src="/assets/history/history.iegte8-2ba4e7bd41fb9ab66b39900f904d6e4a.js" type="text/javascript"></script>
<![endif]-->
It's not perfect (neither is PJAX), but it's pretty good.
from jquery-pjax.
Related Issues (20)
- Multiple fragment processed
- Document links dump bytes in dom
- the current node list is empty
- PJAX memory Leak issue HOT 1
- Link to do just as browser back button HOT 2
- Prevent form submit with pjax when "enter" is clicked in a form element
- In the JavaScript code, Chinese is converted to unicode.
- the documented `ready pjax:end` does not work with Jquery 3.4.1 or 2.2.4 HOT 5
- How to cancel/abort ongoing request?
- Can't run a container cleanup before the cache snapshot
- When using Pjax, the target page is returned without replace the container
- Modal bootstrap is create class modal-backdrop two times when using pjax
- skeleton loading
- Unusual reaction with pjax (Content is duplciating) HOT 1
- New generation Pjax variations HOT 3
- Pjax switch fail: DOM doesn't look the same on new page
- The css class is missed,when i use PJAX,How to reload it?
- Wrong events lifecycle in case when ajax request is not async
- page reload after append link to hmtl
- η»aζ ηΎεζΆζ·»ε ε€δΈͺηΉε»δΊδ»ΆδΈηζ
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jquery-pjax.