Re: passing values to a javascript variable

From: Date: Fri, 22 Jun 2001 03:37:52 +0000
Subject: Re: passing values to a javascript variable
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-54832@lists.php.net to get a copy of this message
echo "<script language='javascript'>" ."\n\tvar ndata = '".addslashes($data_data)."';" ."\n\tPutCode(ndata);" ."\n</script>"; Try that. Chris "TunkeyMicket" Watford -------------------------------- TunkeyMicket Productions www.tunkeymicket.com ----- Original Message ----- From: "Romulo Roberto Pereira" <rpereira@vox2vox.com> To: <php-general@lists.php.net> Sent: Thursday, June 21, 2001 3:38 PM Subject: [PHP] passing values to a javascript variable > Hello! > > The following give me: unterminated string constant (this is a javascript > error) > > when I execute the following: > > while ($row = mysql_fetch_array ($data_query_action)) { > $data_data = $row["data_data"]; > } > echo "<script language=\"javascript\">\n var > ndata=\"".addslashes($data_data)."\";\nPutCode > (ndata);\n</script>"; > > Ideas? Please I need help. > > Thank you, > > Rom > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net > For additional commands, e-mail: php-general-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net

« previous php.general (#54832) next »