Obtain dates with JavaScript before AJAX request

后端 未结 3 1485
误落风尘
误落风尘 2021-01-29 11:47

I have this AJAX request:

function request(str){
    

        
3条回答
  •  情话喂你
    2021-01-29 12:24

    Try this:

    function form() {
        var id = document.getElementById('id').value;
        $("div2").text(id);
    }
    
    $(function() {
        $("#submit").click(function() {
          form();
        });
    });
    

    The syntax for embedding a function call in a jQuery event was incorrect. If you want to execute another function inside a jQuery function, you have to do the above, not .click(function form() {});

提交回复
热议问题