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?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
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!).