I have a javascript function defined somewhere in the middle of my html/php based page like this –
<script language="javascript" type="text/javascript">
function popitup2()
{
newwindow2=window.open('','name','height=265,width=350');
var tmp = newwindow2.document;
tmp.write('<html><head><title>Coupon</title>');
tmp.write('<link rel="stylesheet" href="<?php echo get_bloginfo('wpurl'); ?>/wp-content/themes/street/coupon.css">');
tmp.write('<script src="/street/coupon.js"> </script>');
tmp.write('<script src="http://code.jquery.com/jquery-1.4.2.min.js"</script>');
…
/*some other code which is working fine */
Now this web page appears broken when i open it. But if i remove the the following 2 lines from javascript the error goes and page appears fine.
tmp.write('<script src="/street/coupon.js"></script>');
tmp.write('<script src="http://code.jquery.com/jquery-1.4.2.min.js"></script>');
Can someone tell what is wrong with coding of these lines.
The browser is interpreting the
</script>in the string as the end of the<script>tag.Change it to