You didn't show how you construct the JavaScript string in PHP - I'm sure
the problem is with quoting in there.

Have a look at your output in the browser (do a "View Source" or whatever
your Browser calls it), and check the JS your PHP application constructed.
You'll spot the error...

At 05:28 13.11.2002, Aaron Merrick said:
--------------------[snip]--------------------
>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:
>
>function onoff (elemparent,elem,state) {
>if (loaded) {
>newstate = eval(elem+"_"+state);
>if (n4) {
>menuObj = eval (doc + elemparent + doc2 + elem);
> }
>else if (ie || n6) {
>menuObj = eval (doc + elem + doc2);
> }
>
>I would be grateful for any tips.
>
>Thanks,
>Aaron
>
>
>-- 
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, visit: http://www.php.net/unsub.php
--------------------[snip]-------------------- 

-- 
   >O     Ernest E. Vogelsinger
   (\)    ICQ #13394035
    ^     http://www.vogelsinger.at/



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

Reply via email to