Menu
Hi people
I am running a JavaScript code that needs to include an external JS file if some condition evaluates to true.
I need something like:
[code]
<script language=”JavaScript” type=”text/javascript”>
var condition = ..
if (condition == true) {
<script language=”JavaScript” src=”http://www.mysite.com/file.js”></script>
}
</script>
Obviously this doesn’t work.
Does anyone know how this can be done in JavaScript?
thanks in advance
Jason