Okay, I still get this same error when I move the jsTest to before the function....
FletchSOD "Neal Owen" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > You defined jsTest after the include where it should be before. > > > On Thu, 2004-07-15 at 16:24, Scott Fletcher wrote: > > When an include file contain plain JavaScript codes, with the echo command > > before and after the include file. I get the javascript error saying > > "undefined jsTest"... Anyone know why is that? > > > > --snip-- > > echo "<table><tr><td></td></tr></table>"; > > echo "<script type='text/javascript'>"; > > include('test.inc'); > > echo " var jsTest = 0; "; > > echo "</script>"; > > echo "<form><input type='button></form>"; > > --snip-- > > > > Let's say the script in the test.inc contain > > > > --snip-- > > function test() { > > if (jsTest != 0) { > > //blah blah balh... > > } > > } > > --snip-- > > > > Thanks, > > FletchSOD > -- > Neal Owen | IT Programmer > Marketing Resources, Inc. > Main : 312.238.8923 x1218 > Direct : 630.592.3118 > > [EMAIL PROTECTED] | http://www.mrichi.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php