jQuery Ajax simple call

前端 未结 2 358
忘掉有多难
忘掉有多难 2020-12-01 12:08

I\'m trying a basic ajax call. So I\'m hosting the following test php on a test server: http://voicebunny.comeze.com/index.php?numberOfWords=10 This web page is my own t

2条回答
  •  北海茫月
    2020-12-01 12:54

    please set dataType config property in your ajax call and give it another try!

    another point is you are using ajax call setup configuration properties as string and it is wrong as reference site

    $.ajax({
    
        url : 'http://voicebunny.comeze.com/index.php',
        type : 'GET',
        data : {
            'numberOfWords' : 10
        },
        dataType:'json',
        success : function(data) {              
            alert('Data: '+data);
        },
        error : function(request,error)
        {
            alert("Request: "+JSON.stringify(request));
        }
    });
    

    I hope be helpful!

提交回复
热议问题