简体   繁体   English

为什么我得到:未捕获的SyntaxError:此处出现意外的令牌ILLEGAL

[英]Why am I getting : Uncaught SyntaxError: Unexpected token ILLEGAL here

I have this simple script: 我有这个简单的脚本:

    ids="22656"
    url = "http://api.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. GET周围的报价不合适。 You must use standard single or double quotes for strings. 您必须对字符串使用标准的单引号或双引号。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM