Why can't you say :
<SCRIPT LANGUAGE="JavaScript">
<? if ($data == "whatever") { ?>
function MYfunction() {
statement...
}
>? }
else {
?<
function MyFunction2() {
Statement...
}
<? } ?>
That way you can control the variable a different way...
Richie Akins wrote:
Javascript seems to dislike temporarily giving up processing to php. Example,
if(var adata = "<?php echo $data; ?>" == "")
{
STATEMENT
STATEMENT
}
Javascript gives errors in the above, even though all we want is for php to supply $data to javascript.
One roundabout way I dealt with it was to store $data in a cookie, then use javascript to read the cookie.
I'll be interested in knowing about an easier solution.
Richie
-----------------------geocities.com/akindele/