seran128 Posted December 7, 2006 Share Posted December 7, 2006 I am getting this error in my javascript my code where the error is being generated and in redthe output of this in the bottom of my browser looks like javascript: buynow(500 Gold,125.00);but when I press on the image i get the errormissing ) after argument list I believe its needing to have the text wraped in '500 Gold' but I can't figure how do do that in the code below.[code]$specials .= "<table width='200' border='0' > <tr> <td align='center'>" . stripslashes($row['short_description']) . "</td> [color=red]<td align='center'><a href='javascript: buynow(". stripslashes($row[title]) .",".$row[real_cost].");'><img src='/images/bnscroll.png' width='40' height='26' align='absmiddle' border='0' /></td>[/color] </tr> <tr> <td align='center' colspan='2' ><span class='copy'>...........................................</span></td> </tr> </table>";[/code] Link to comment https://forums.phpfreaks.com/topic/29765-missing-after-argument-list/ Share on other sites More sharing options...
Psycho Posted December 7, 2006 Share Posted December 7, 2006 When specifying a string and enclosing it in double quotes, you can include double quotes within the string itself by escaping them by preceeding them with a backward slash. The same goes for including single quotes within a string enclosed with single quotes:[code]<?php$specials .= "<table width=\"200\" border=\"0\" > <tr> <td align=\"center\">" . stripslashes($row['short_description']) . "</td> [color=red]<td align=\"center\"><a href=\"javascript: buynow('". stripslashes($row[title]) ."','".$row[real_cost]."');\"><img src=\"/images/bnscroll.png\" width=\"40\" height=\"26\" align=\"absmiddle\" border=\"0\" /></td>[/color] </tr> <tr> <td align=\"center\" colspan=\"2\" ><span class=\"copy\">...........................................</span></td> </tr> </table>";?>[/code] Link to comment https://forums.phpfreaks.com/topic/29765-missing-after-argument-list/#findComment-136672 Share on other sites More sharing options...
artacus Posted December 7, 2006 Share Posted December 7, 2006 You need to have non-numeric parameters quoted.javascript: buynow("500 Gold","125.00"); Link to comment https://forums.phpfreaks.com/topic/29765-missing-after-argument-list/#findComment-136676 Share on other sites More sharing options...
artacus Posted December 7, 2006 Share Posted December 7, 2006 Two answers for the price of one. :) Link to comment https://forums.phpfreaks.com/topic/29765-missing-after-argument-list/#findComment-136678 Share on other sites More sharing options...
Psycho Posted December 7, 2006 Share Posted December 7, 2006 [quote author=artacus link=topic=117679.msg480287#msg480287 date=1165466339]You need to have non-numeric parameters quoted.javascript: buynow("500 Gold","125.00");[/quote]He already stated he thought that was the problem. His problem was he didn't know how to include it in the string. Link to comment https://forums.phpfreaks.com/topic/29765-missing-after-argument-list/#findComment-136680 Share on other sites More sharing options...
artacus Posted December 7, 2006 Share Posted December 7, 2006 Ok then, and answer and a half for the price of one. Link to comment https://forums.phpfreaks.com/topic/29765-missing-after-argument-list/#findComment-136687 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.