RE: [PHP] PHP & Java ?

From: Date: Fri, 04 May 2001 17:24:11 +0000
Subject: RE: [PHP] PHP & Java ?
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-51449@lists.php.net to get a copy of this message
Is there any way that we can see the page? That might help in sorting out the problem Thank you Brian Paulson Sr. Web Developer bpaulson@chieftain.com http://www.chieftain.com 1-800-269-6397 -----Original Message----- From: Jack Sasportas [mailto:jack@innovativeinternet.com] Sent: Friday, May 04, 2001 11:22 AM To: php Subject: Re: [PHP] PHP & Java ? I am echoing the javascript and other html, and at this point *not* putting values into the javascript. I take a string like so: $string=" JavaCode.... HTML<Stuff> "; I make sure that *everything* in the quotes has only sinlge quotes no double quotes so that PHP doesn't think its the end of the string, then I echo $string; Somehow the java mouseover breaks, then I tried taking the java mouseover single quotes and putting them back to double quotes preceeded by a \ to tell php to ignore that quote, but that didn't work either. Is it the way I am echoing or something ? Thanks ! Peter Dudley wrote: > If it's javascript, then be careful about echoing PHP variables into > Javascript strings. If you have something like (in Javascript) > > var myString = '<?php echo $phpString; ?>'; > > and $phpString contains any apostrophes, then the javascript will break > because Javascript thinks the string has ended prematurely. E.g, if > $phpString is "My cat's pajamas" then the javascript would be sent to the > browser thus: > > var myString = 'My cat's pajamas'; > > and you can see that there are too many single quotes, which will, of > course, cause Javascript's high-powered debugging utilities to kick in and > give you a highly useful error report. > > Pete. > > > While working on some web sites which contain mouse over java, and then > > adding in some db stuff via php/mysql, the java seems to break. > > Is there something special I need to do to prevent that break? > > Is this a common problem? > > Does using templates get around that problem ? > > -- > 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 -- ___________________________________________________________ Jack Sasportas Innovative Internet Solutions Phone 305.665.2500 Fax 305.665.2551 www.innovativeinternet.com www.web56.net -- 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 (#51449) next »