Hi, i have a code in javascript that run's well.... the file has the extension ".htm". I renamed the file to ".php" and i echo-ed all the lines, to work under php.... but i'm getting this error : 'Object expected' Line 1, Char 1. My first lines are: '<?php echo "<SCRIPT language=\"JavaScript\">"; echo "<!--"; echo "var f = 0;"; echo "function addInput () "; echo "{"; ............ ' So what's the problem here? Thanks a lot
I have a hunch that your code is doing the reverse of what is acceptable with code between javascript and php. Javascript is client side scripting PHP is server side scripting Javascript is dynamic where as php is static i believe. You can output a php statement such as email_list[0] = "<?php echo $email_list[0]; ?>"; the first array is in javascript the second array with a dollar sign is in php they are separate email_list[0] = "<?php echo $email_list[0]; ?>"; maybe you need to output a php statement from javascript and not output javascript statemtns from php i woudl suggest rearranging your code so that the tags encapsulate your php code and your java script code assigns values based on your php echo statements which will be embedded in your javascript statements with the tag identifiers. good luck