Can anyone point out what might be the mistake here in this javascript. The first statement executes just fine but when i add another statement that is to be executed simultaneously, it doesn’t work.
echo '<script language="JavaScript" type="text/javascript">
//<![CDATA[
window.open(\'./index_pdf.php?'.$query_string.'\',\'Einlagerung_EV\',\'location=no,menubar=no,resizable=yes,scrollbars=yes,status=yes,toolbar=no\');
//]]>
</script>';
echo'<script language = "JavaScript" type="text/javascript">
//<![CDATA[
window.open('./save.php?','location=no,menubar=no,resizable=yes,scrollbars=yes,status=yes');
//]]>
</script>';
You are stopping the script here:
window.open('./save.php?','location=no,menubar=no,resizable=yes,scrollbars=yes,status=yes');Use it like this:
As you can see in the 1st example, it is using
\', but you are using plain'. Since you open the tag with', you cant use that symbol inside the script unless you want to break it intentionally. The symbol\lets you use the quotes, without braking the script.