开发者

Why am I getting : Uncaught SyntaxError: Unexpected token ILLEGAL here

开发者 https://www.devze.com 2023-02-14 05:01 出处:网络
I have this simple script: ids=\"22656\" url = \"http://ap开发者_JAVA技巧i.stackoverflow.com/1.0/users/\"+ids+\"/timeline\";

I have this simple script:

    ids="22656"
    url = "http://ap开发者_JAVA技巧i.stackoverflow.com/1.0/users/"+ids+"/timeline";
    console.log( url );
    xmlhttp = new XMLHttpRequest();
    xmlhttp.open(“GET”, url ,true);
    xmlhttp.onreadystatechange=function() {
        if (xmlhttp.readyState==4) {
            console.log( xmlhttp.responseText );
        }
        xmlhttp.send( null );
    };    

But I don't quite understand why I'm getting:

Uncaught SyntaxError: Unexpected token ILLEGAL

Can someone shed some light on this?


The quotes around GET are not proper. You must use standard single or double quotes for strings.

0

精彩评论

暂无评论...
验证码 换一张
取 消