scott1964 — 2014-07-29T12:45:35-04:00 — #1
I have a simple page where I am testing a "First Time Visitor" popup window. I am using CoverPop for this. http://coverpopjs.com/.
It's a hard thing to test because as soon as you test it, you now have the cookie inserted and will have to manually remove it before testing again ... very awkward. Anyway ...
It works great in every browser except IE.
I was wondering if anybody knew of a work around for this. Maybe a conditional line of code that would make this work when viewed in IE?
Thanks. Here's the page: http://www.savagepixels.com/wti/
scott1964 — 2014-07-29T13:31:58-04:00 — #2
SCRIPT438: Object doesn't support property or method 'querySelectorAll'
CoverPop.js, line 52 character 9
paul_wilkins — 2014-07-29T18:02:00-04:00 — #3
You can use this polyfill.js file to deal with situations where the browser doesn't know how to do querySelectorAll
felgall — 2014-07-29T18:12:02-04:00 — #4
What version of IE are you using?
The last FOUR versions of Internet Explorer all support querySelectorAll and the versions earlier than that are all effectively dead with almost no one using them any more - even IE9 is now effectively dead (although IE8 still has a few too many users to completely ignore - although many web sites are now moving toward letting those users see the pages the same as all the other long dead browser users see).
Of course using a polyfill means that you can still support users of prehistoric browsers where only those users have the script run extra slow because of the polyfill while everyone using modern browsers gets the full benefit of the modern coding in the script.
scott1964 — 2014-07-29T19:04:30-04:00 — #5
That would be awesome. Is it just a matter of including that file? Or does it need to be configured? I can't seem to figure out if the whole thing should be added in the head or down underneath the markup where you'd normally put something that is DOM dependent.
scott1964 — 2014-07-29T19:05:34-04:00 — #6
Forgot to mention I have only IE 9 here.
felgall — 2014-07-29T22:17:17-04:00 — #7
IE9 is one of the versions of IE that supports querySelectorAll so you should not need a polyfill for that version.
scott1964 — 2014-07-29T23:08:01-04:00 — #8
That explains why it works for me and not my client. They are checking it on a version earlier I take it.
Does the polyfill work as a shim for the earlier versions? I'll admit I have no idea what this include is doing.
Would I just include that code down underneath the popup markup?
The reason I ask is, I can't test this myself. Or at least haven't figured out a way. It all works on my machine but the client is saying it won't show the popup on the earlier versions of IE.
felgall — 2014-07-30T15:43:36-04:00 — #9
They would need to be using IE7 or earlier for the code without the polyfill not to work.
Just include the script reference to the polyfill code with the rest of your scripts in the page. Polyfills are usually coded in such a way that they first test if the browser supports the command and only if it doesn't do they then run their code to emulate the missing command.
scott1964 — 2014-07-31T19:41:35-04:00 — #10
Great. Thanks so much for your assistance