I have a HTML page.
In that, according to the browser, I need to include a separate JavaScript file.
How is it possible?
<script type="text/javascript">
if(navigator.appName == 'Microsoft Internet Explorer')
{
//here i need to include one.js
}
else
{
//here i need to include two.js
}
</script>
And finally, if you're already using JQuery in your project and just left out the tag for it, you can use $.getScript
I recommend you to use LAB.js or YepNope (script loaders). Both make great effort on loading external scripts the best way possible.
For an example, using YepNope, with two conditional loads: