<script> var scriptName = 'script2.js'; if(navigator.userAgent.toLowerCase().indexOf('msie') != -1) { scriptName = 'script1.js'; } document.write('<scr' + 'ipt src="' + scriptName + '"></scr' +'ipt>'); </script>