I am emebd
I am embedding PHP script in to JavaScript. I have a page made of JavaScript and in the middle I am embedding the below PHP if statement. I am using back slash to escape the JavaScript single quote ‘ character.
<?php
if ($type==\'Price\'){
echo \'document.write(\\'<FRAME name= \"hotelcontent\" scrolling=\"AUTO\" SRC=\"price.html\">\\')\';
echo \'document.write(\\'</frameset>\\')\';
}else{
echo\'document.write(\\'<FRAME name=\"hotelcontent\" scrolling=\"AUTO\" SRC=\"http://agents.hotelconnect-online.com/hotelconnect/descriptions/hotel.asp?citycode=bar\">\\')\';
echo \'document.write(\\'</frameset>\\')\';
}
?>
But I am getting error which says missing ; before the statement . As if the missing is before document.write(\'</frameset>\')
document.write(\'<FRAME name= \"hotelcontent\" scrolling=\"AUTO\" SRC=\"price.html\">\')
document.write(\'</frameset>\')
Could any one help where Iam doing wrong?