How can I check if the browser you are using supports the HTML5 history api?
As you can see here http://caniuse.com/#search=history only chrome +ff4 and several others supports this and I wish to do something else if they cant support this.
How can I make some kind of an if statement for this checking?
The getContext method is checked by accessing it on the created input object. The result of this expression is checked with an if-statement. If the result is true, it means that HTML5 is supported by the browser.
HTML5 is now compatible with all popular browsers (Chrome, Firefox, Safari, IE9, and Opera) and with the introduction of DOCTYPE, it is even possible to have a few HTML features in older versions of Internet Explorer too.
The HTML5 History API gives developers the ability to modify a website's URL without a full page refresh. This is particularly useful for loading portions of a page with JavaScript, such that the content is significantly different and warrants a new URL. Here's an example.
if (window.history && window.history.pushState)
See also this All-In-One Almost-Alphabetical No-Bullshit Guide to Detecting Everything
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With