Reputation: 3332
Before I get chided over this being an old question , I have done my research on it and conditional statements in the HTML seem to be a strict no with IE10+ no longer supporting them and hence any condition statements I write using [if lt IE 9]
are not adhered to when using IE10 and above. So in my opinion this method is crossed.
I didn't find any clear answer for if using 1.8+ over the browser with the version and don't want to use raw javascript. I could use modernizer but I just have one line of code to include in the condition and don't want to add in the extra load if that were possible to be implemented using some jquery snippet.
Suggestions?
Upvotes: 1
Views: 852
Reputation: 135
Adding more info,
http://tanalin.com/en/articles/ie-version-js/
IE versions Condition to check for
IE 10 or older - document.all
IE 9 or older - document.all && !window.atob
IE 8 or older - document.all && !document.addEventListener
IE 7 or older - document.all && !document.querySelector
IE 6 or older - document.all && !window.XMLHttpRequest
IE 5.x - document.all && !document.compatMode
Hope it helps
Upvotes: 0
Reputation: 3332
Ok, so after a little research, decided to use neither JQuery nor modernizer and am utilizing browser capabilities on IE9+ to write conditional code for I8 and below -
<script>
if(!document.addEventListener){
//code for IE8 and below
}
</script>
Kind of a hack but it works and fingers crossed :)
Upvotes: 3