How to get data from one php page using ajax and pass it to another php page using ajax

后端 未结 4 528
野性不改
野性不改 2021-01-22 08:45

I am trying to get data from one php page and pass it to another page using Ajax.

JS :

$.ajax({
      url: \"action.php\",
      succes         


        
4条回答
  •  广开言路
    2021-01-22 08:55

    Try to use $.get() method to get/send data :

    $.get("action.php",{}, function(data){
        //data here contain 1
        $.get("data.php", {id: data}, function(id){
             alert(id);
        }
    });
    

    Just echo $test since just the data printed in page will return as responce to the query request.

    action.php :

    
    

    Hope this helps.

提交回复
热议问题