如何返回值

时间:2019-04-18 16:47:30

标签: javascript jquery html ajax

查看我的代码,请查看我的问题

$('#StartPiCam').click(function(){
            $.ajax({
                url: "StartPiCam",
                type: "GET",
                data: "value=1",
                //dataType: "json",
                //success: onDataReceived
            });
            $.ajax({
                url: "PiCam_Brightness",
                type: "GET",
                data: "Brightness={$('#Brightness').val()}",
                //dataType: "json",
                //success: onDataReceived
            });
        });


<INPUT ID="Brightness" TYPE=TEXT NAME="Brightness" VALUE="50" SIZE=12 MAXLENGTH=3 NOFINSIDE="~!   ~!" >

它返回0,但我希望返回输入“亮度”的值

1 个答案:

答案 0 :(得分:0)

更改了数据格式

根据我的看法,这会起作用。

$('#StartPiCam').click(function(){
            $.ajax({
                url: "StartPiCam",
                type: "GET",
                data: {value: '1'},
                //dataType: "json",
                //success: onDataReceived
            });
            $.ajax({
                url: "PiCam_Brightness",
                type: "GET",
                data: {Brightness: $('#Brightness').val()}",
                //dataType: "json",
                //success: onDataReceived
            });
        });