开发者

Javascript syntax for passing PHP variables

HELLO EVERYONE :D

I am having some diffculties passing php varaibles through javascript.

Basically this is the statement:

new Ajax.Updater( 'result', 'update_request.php?status='+status_change);

and I need to pass another variable after status_change, the variable I need to pass is the id of the ticket that is being updated.

So I tried this:

new Ajax.Updater( 'result', 'update_request.php?status='+status_change'&requestid='+request_id);

However this gives me an error stated below:

Webpage error details

Message: Expected ')' Line: 128 Char: 77 Code: 0 URI: http://site_url/dev/time_off_new/main.php

I have tried double quotes, as well as a comb开发者_Go百科ination. I do not know why it is giving me such harrassment.

I ran the php script that it is attached to, and everything is working fine. After debugging I have narrowed it down to this statement, so everthing else is working fine.

Thank you ahead of time.

Peace and love!


You are missing a concatenation operator after the variable status_change

Try this

new Ajax.Updater( 'result', 'update_request.php?status='+status_change+'&requestid='+request_id);
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜