Hi everyone
I have just created the following webpage http://www.dor2dor.com/client-testimonials.html whcih filters results based on your selection. Unfortunately this works perfectly on every browser except from blody internet explorer. I can for the life of me work out why this is any pointers would be much appreciated.
NessaFrankling wrote:
Unfortunately this works perfectly on every browser except from blody internet explorer. I can for the life of me work out why this is any pointers would be much appreciated.
IE 9 has a very useful set of Developer Tools, which you access by pressing F12. If you open the Console, it tells you that the problem is on line 30 of testimonails.js. The history object in IE doesn't support the pushState() method.
No, sorry. That JavaScript file is more than 2000 lines long. I suggest that you contact the author of the file, and report the fact that it doesn't work in IE 9. The script is doing a lot of browser sniffing to find out which make and version of browser is being used. The error lies in that part of the code rather than just in line 30.
The history.pushState() method is a new HTML5 feature, which IE apparently doesn't support until IE 10.
You can either use history.js to provide a cross-browser solution, or you can try using a nonstandard IE feature. According to an article in the Mozilla Developer Network, IE supports a string URL as a parameter for history.go().
I haven't tried it out, but you might be able to adapt line 25 like this:
if (window.history.pushState) {
window.history.pushState('data', "Title", "/client-testimonials.html");
} else {
window.history.go("/client-testimonials.html");
}
Also change line 30 like this:
if (window.history.pushState) {
window.history.pushState('data', "Title", "/client-testimonials.html#" + scope);
} else {
window.history.go("/client-testimonials.html#" + scope);
}
I'm glad that worked. I wasn't aware that IE supported that nonstandard use of history.go() until I stumbled across it on the Mozilla site.
In one sense, life will be a lot simpler when all browsers support the new JavaScript APIs because the same script should work anywhere. But it will become a lot more complicated because there will be so many features we'll have to remember how to use. ![]()
North America
Europe, Middle East and Africa
Asia Pacific