Hello,

"Aaron Merrick" <[EMAIL PROTECTED]> wrote:

> Folks,
>
> Can't see an answer anywhere in the archives, so here goes.
>
> This works fine in plain html:
>
> <body onload="start();initialize();onoff('mainmenu',section,'on')"
> onresize="window.location.reload(false)" topmargin="1" bottommargin="0"
> leftmargin="0" rightmargin="0">
>
> When I put it in PHP thus:
>
> echo "<body onload=\"start();initialize();onoff('mainmenu',section,'on')\"
> onresize=\"window.location.reload(false)\" topmargin=\"1\"
> bottommargin=\"0\" leftmargin=\"0\" rightmargin=\"0\">";
>
> When the page loads, I get an "Error: 'menuObj' is null or not an object"
>
> The onoff() function is what contains the menuObj, so I suspect the single
> quotes around the parameters mainmenu and on, but have tried everyway I
can
> think of and can't get rid of the Error.
>
> The function is thus:
>

I think php is parsing your js code. Have you tried echoing with single
quotes?

echo '<body onload="start();initialize();onoff(\'mainmenu\',section,\'on\')"
onresize="window.location.reload(false)" topmargin="1" bottommargin="0"
leftmargin="0" rightmargin="0">';

- E


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to