keithclark / selectivizr

selectivizr is a JavaScript utility that emulates CSS3 pseudo-classes and attribute selectors in Internet Explorer 6-8.
1.71k stars 247 forks source link

ability to lazyload in selectivizr #4

Closed paulirish closed 13 years ago

paulirish commented 13 years ago

I'd like to load selectivizr.js into the page only if I'm in a browser that I'll need it.

this is related to issue #3. as document.write will blow up attempts to lazy load scripts.

the trick is selectivizr.js might load before or after "dom ready" .. so we'll need to watch the document.readyState instead of waiting for events to fire (that already did). i think..

paulirish commented 13 years ago

ps. thanks for being on github!!! :) i very much enjoyed reading through the source.

ZeeAgency commented 13 years ago

https://github.com/keithclark/selectivizr/pull/6

I join Paul : thx for putting the source on github :-)

keithclark commented 13 years ago

I've updated the script to include Diego Perini's new ContentLoaded method which appears to solve this issue.

It would be great if you could test it in a live environment.

keithclark commented 13 years ago

Closed