Hi,
My problem is about slashes and quotes. Im developing a Php game, where I have to generate some Javascript with PHP. The problem I'm currently facing is where the heck should the slashes be :P I have been experienting with this for some time, but without any effect.
$clothing_optio ns value:
String I'm printing out
The problem is, that the Take off button doens't work. The javascript (ajax) paar worked fine before I started to recode the window part...Now it gives me "syntax error on line 2", however neather the line 2 in the index.php/module.php or javascript file has anything to do with that.
I know the code is messy and Im sorry for that (but it still is a result of hours of random experiments :P), but any hints what to do would be fine. Or is it even possible to call a function in a function like that?
My problem is about slashes and quotes. Im developing a Php game, where I have to generate some Javascript with PHP. The problem I'm currently facing is where the heck should the slashes be :P I have been experienting with this for some time, but without any effect.
$clothing_optio ns value:
Code:
<input type=\"submit\" value=\"Take off\" onclick=\"player_image(\"user_image\",'.$item['id'].')\">'
Code:
echo "<td><a href=\"#\" onClick='popout(this,\"Amount: ".$items[$a][1]."<br />$clothing_options\");return false;' onmouseout=\"exittoolarea(1250);\"><img src=\"images/things/$item[pilt]\" border=\"0\"></a></td>";
I know the code is messy and Im sorry for that (but it still is a result of hours of random experiments :P), but any hints what to do would be fine. Or is it even possible to call a function in a function like that?
Comment