Post data to JsonP

后端 未结 7 1333
傲寒
傲寒 2020-11-22 07:22

Is it possible to post data to JsonP? Or does all data have to be passed in the querystring as a GET request?

I have alot of data that I need to send to the service,

7条回答
  •  悲&欢浪女
    2020-11-22 08:19

    It is possible, here is my solution:

    In your javascript:

    jQuery.post("url.php",data).complete(function(data) {
        eval(data.responseText.trim()); 
    });
    function handleRequest(data){
        ....
    }
    

    In your url.php:

    echo "handleRequest(".$responseData.")";
    

提交回复
热议问题