views:

20

answers:

0

I get the "unterminated string literal" error with this code. This code used to work by using escaped quotes. Not possible now because because Google Adsense is including several script files.

    <script type="text/javascript">
<!--
var t=0;
var myArray = [];
myArray[0]= 'condition1';
myArray[1]= 'condition2';
myArray[2]= 'condition3';
myArray[3]= 'condition4';
myArray[4]= 'condition5';
for(var i=0;
i<5;
i++) {
if (document.referrer.indexOf(myArray[i]) > -1)
{
//-->
document.write('<?php include('AdSense.htm'); ?>'); 
t++; 
}
else  document.write('<?php include('otherAds.htm'); ?>'); 
}

Obviously I am not able to edit the included Google code with escaped quotes or concatenated lines, or any of the common solutions to this problem. I do have a working solution in PHP, but need to have a JavaScript answer.