"JohnS" <Pl**********@myaccount.com> writes:
I have included in my html code (SRC) a file that I want Javascript to
ignore, but PHP to execute (if parsed by PHP)
the js function is:
function justphp(f) {
$test="<?php die(); ?>";
return;
}
In javascript the variable $test is just a string and will never be used,
but in PHP it will die when executed.
The PHP is executed on the server, long before the javascript is
executed on the client. If the "die" function stops PHP execution,
then I bet the rest of the page from there is never sent to the browser,
including the end quote.
whenever I read it as javascript though I get a runtime error:
Line 2: Error: Unterminated string constant.
PHP works fine.
But my string IS terminated! Why does it not just assign the string and
ignore it, like it is supposed to...
Or what am I missing?
What is the code that is sent to the browser? I bet the answer is in
there, since that is the code that contains the error.
/L
--
Lasse Reichstein Nielsen -
lr*@hotpop.com
Art D'HTML: <URL:http://www.infimum.dk/HTML/randomArtSplit.html>
'Faith without judgement merely degrades the spirit divine.'