weixin_33701251 2017-07-11 14:16 采纳率: 0%
浏览 8

在jQuery中输入文本值

This Code note note working Please help. I try to know more about Jquery, Ajax Get & Post. Can use the code in PhoneGap App?

I use this tutorial - https://www.w3schools.com/jquery/tryit.asp?filename=tryjquery_ajax_post

<script>
$(document).ready(function(){
    $("button").click(function(){
    var a= $("#test1").val();
    var b= $("#test2").val();

        $.post("demo_test_post.asp",
        {
          name: a,
          city: b
        },
        function(data,status){
            alert("Data: " + data + "
Status: " + status);
        });
    });
});
</script>
 <p>F Name: <input type="text" id="test1" value="Mickey Mouse"></p>

<p>S Name: <input type="text" id="test2" value="Mickey Mouse"></p>


<button>Send an HTTP POST request to a page and get the result back</button>

But this change had worked

 var a= "FName";
    var b= "SName";
  • 写回答

0条回答 默认 最新

    报告相同问题?