vojtech-dobes / history.nette.ajax.js

Adds History API support to nette.ajax.js addon!
30 stars 27 forks source link

$.nette.ext('history') returns undefined iOS 10 #35

Open jirkae opened 7 years ago

jirkae commented 7 years ago

After upgrading to iOS 10, there are this error $.nette.ext('history') (appear for example on this line: $.nette.ext('history').cache = false;)

JakubJarabica commented 7 years ago

Anybody looking into this, please?

Tomas2D commented 7 years ago

If you take a look at the beginning of history.ajax.js file, you can see this condition.

if (!(window.history && history.pushState && window.history.replaceState && !navigator.userAgent.match(/((iPod|iPhone|iPad).+\bOS\s+[1-4]|WebApps\/.+CFNetwork)/))) return;

As you can see, history.ajax.js is not supported on iOS devices.

So you have add condition to your code.

if($.nette.ext('history') !== undefined) { // your code goes here .. }