In a html file , inside the body tag I’ve these lines of code
<script type="text/javascript" src="http://xxx.com/js/publisher/promo.js"></script>
and in the promo.js file, I’ve put these lines
<script type="text/javascript" src="/js/jquery-1.3.2.min.js?v=5-5-09"></script>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js"></script>
<script type="text/javascript" src="/js/lazyload.js"></script>
and I get a javascript error(missing ; before statement) on the second line of promo.js file when I load the html file in the browser. Any ideas on why this is happening ?
JavaScript files do not recognize HTML text.
In your promo.js file, if you have that text in it, that is not valid javascript.
If you want to include additional scripts from your javascript file, you will need to dynamically add javascript file references.