jquery $.GET parameters passing in the url

前端 未结 2 1090
走了就别回头了
走了就别回头了 2021-01-05 09:19

this is a general-purpose way to make GET requests with Jquery:

var loadUrl=\"mypage.php\";
$(\"#get\").click(function(){   
    $(\"#result\").html(ajax_loa         


        
2条回答
  •  慢半拍i
    慢半拍i (楼主)
    2021-01-05 10:08

    Yes that is possible but you can also do it this way.

    $.get(
       "mypage.php", 
       { version: "5", language: "php" }, // put your parameters here
       function(responseText){
          console.log(responseText);
       },
       'html'
    );
    

提交回复
热议问题