Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/439.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript jQuery获取发送回的数据_Javascript_Jquery_Ajax - Fatal编程技术网

Javascript jQuery获取发送回的数据

Javascript jQuery获取发送回的数据,javascript,jquery,ajax,Javascript,Jquery,Ajax,使用jQuery.get方法时如何获取数据 function send_data(pgId) { for(var i = 0; i < pgId.length; i++) { // $.get(url, data, success(data, textStatus, jqXHR)) $.get('index.php?page=' + pgId[i], pgId[i], function(respTxt, status, xhr)

使用jQuery.get方法时如何获取数据

function send_data(pgId)
{
    for(var i = 0; i < pgId.length; i++)
    {
        // $.get(url, data, success(data, textStatus, jqXHR))
        $.get('index.php?page=' + pgId[i], pgId[i], function(respTxt, status, xhr)
        {
            if(status === "success")
            {
                alert("Data received: " + respTxt + "\n");
                alert("Data sent: " + pgId[i]); //<-- ???
            }
        });
    }
}
函数发送数据(pgId)
{
对于(变量i=0;i