简体   繁体   中英

Conditional Comment to run for all browsers except IE 8 and below

how can i write a conditional comment for scripts that should run for all browsers except IE 8 and below?

i saw Conditional comment for 'Except IE8' ?

but how do i adapt it to include scripts files not inline scripts?

The trick explained there would work just as well for external scripts — set a "this browser is old" flag in a conditional-commented inline script, and have your external scripts check for that flag.

If you mean to conditionally include entire script files, your best bet would probably be a script that browser-sniffs and dynamically includes the appropriate files. Otherwise, you could use downlevel-revealed conditional comments (thanks, bobince!).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM