0
在我的代碼中,我需要調用帶有json文件作爲參數的Web服務。使用動態值創建json
this.myWebService.call({「UserId」:「1」});
上面這行是我的web服務調用。這裏UserId的值是動態的對於eg.the userId是1或userId是2或3等等......我如何動態地將這個ID與我得到的值從我的程序。
請幫忙。
在我的代碼中,我需要調用帶有json文件作爲參數的Web服務。使用動態值創建json
this.myWebService.call({「UserId」:「1」});
上面這行是我的web服務調用。這裏UserId的值是動態的對於eg.the userId是1或userId是2或3等等......我如何動態地將這個ID與我得到的值從我的程序。
請幫忙。
是否會PHP的話,我會做
<script type="text/javascript">
var userId = <?php echo $user_id ?>;
this.webService.call("UserId": userId});
</script>
希望這有助於!