Get PHP generated Javascript to work

From: Date: Fri, 16 May 2003 17:39:18 +0000
Subject: Get PHP generated Javascript to work
Groups: php.general 
Request: Send a blank email to php-general+get-147938@lists.php.net to get a copy of this message
I have a drop dow list with the following options: "<option name=\"title$i\" value=\"$id\" onChange=\"return reloadLoc();\">$element</option>\n"; It is getting built in a while loop. I also have a file called loc.html that holds the java script function. So I read in that function with the following method: function SetScripts($filename) { $handle = fopen($filename, "r"); $contents = fread($handle, filesize($filename)); $this->scripts = $contents; fclose($handle); } $this->scripts then gets passed to a display() function. The HTML looks good in the source code of the page but does not execute. Here is my JS: <script language="JavaScript1.4" type="text/javascript"> function reloadLoc() { window.location.href = "http://cajunmikes.com/adminform.php?table=$id"; window.location.reload(); } </script> Any insights why it won't work? /T

« previous php.general (#147938) next »