开发者

Creating a json with dynamic values

In my code i need to call a web service with a json file as argument.

this.myWebService.call({"UserId" : "1"});

the above line is my webservice call.Here the UserId 's value is dynamic For eg.the userId is 1 or userId is 2 or 3 , etc...How do i 开发者_C百科pass this ID dynamically with a value I get from my program.

Please help.


if it would have php then i would have done

<script type="text/javascript">

var userId = <?php echo $user_id ?>;

this.webService.call("UserId": userId});

</script>

Hope this helps!!!

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜