Okay here is the full source code of the script I'm playing with:
var isOpera = !!window.opera || navigator.userAgent.indexOf('Opera') >= 0;
// Opera 8.0+ (UA detection to detect Blink/v8-powered Opera)
var isFirefox = typeof InstallTrigger !== 'undefined'; // Firefox 1.0+
var isSafari = Object.prototype.toString.call(window.HTMLElement).indexOf('Constructor') > 0;
// At least Safari 3+: "[object HTMLElementConstructor]"
var isChrome = !!window.chrome; // Chrome 1+
var isIE = /*@cc_on!@*/false; // At least IE6
if (isFirefox) {
// do FireFox stuff here
} else if (isChrome) {
// do Chrome stuff here
} else if (isSafari) {
// do Safari stuff here
} else if (isOpera) {
// do Opera stuff here
} else if (isIE) {
// do IE stuff here
} else {
// other browser
}
Then under each if/else statement, I need to somehow "run":
<script type="text/javascript" src="./include/js/newupdates.js"></script>
<div id="auto"></div>
Or something similar depending on browser. I looked at Modernizer and it confused the heck out of me. The above example works and successfully detects all the browsers I need it to, I just don't know how to have the script execute certain HTML/JS code INSIDE the if/else statement...