Jim Long combination php javascript syntax problem
Aug 23, 2009; 16:14
Jim Long
combination php javascript syntax problem
Hi,
I have this link that pops a window, written inside a php echo statement:
echo"<a href=\"javascript:popUp('gvdsonginfo.html?title=$chunk[0]') \">» Check for info</a><br /><br />\n";
It works fine, until the var $chunk[0] contains a song title with an apostrophe -- then the code breaks because of the single quotes in the javacode syntax
I've tried several other combinations of quotes and double quotes, delimiters etc.. but have yet to hit on something that works.
Here's the function using eval that the link calls: <SCRIPT LANGUAGE="JavaScript">
function popUp(URL) { id = "tunes"; eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,wid th=500,height=300,left = 590,top = 375');"); } </script>
Anyone have an idea?
Thanks j
-- This list is a free service of LassoSoft: http://www.LassoSoft.com/ Search the list archives: http://www.ListSearch.com/GoLive/Browse/ Manage your subscription: http://www.ListSearch.com/GoLive/
Search
Lasso Programming
This site manages and broadcasts several email lists pertaining to Lasso Programming and technologies related and used by Lasso developers. Sign up today!