jquery $.GET parameters passing in the url

前端 未结 2 1087
走了就别回头了
走了就别回头了 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条回答
  • 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'
    );
    
    0 讨论(0)
  • 2021-01-05 10:14
    $.get(
    
      url: url,    //your url eg. mypage.php
    
      data: data,   // Parameter you want to pass eg. {version:"5" , language : "php"}
    
      success: callback // function after success
    
    );
    

    follow the below link

    http://api.jquery.com/jQuery.getJSON/

    0 讨论(0)
提交回复
热议问题