未捕获的SyntaxError:意外令牌非法控制台

Uncaught SyntaxError: Unexpected token ILLEGAL console

本文关键字:意外 令牌 非法 控制台 SyntaxError      更新时间:2023-09-26

好的,抱歉stackoverflow社区对我的最后一个问题和我的行为,所以我会尝试格式化我的问题和其他任何必要的;

我的主要问题:意外令牌非法意味着什么和/或它是如何触发的?据我所知,我的其他剧本都没有触发它,为什么现在呢?

我的其他假设:这只是一个常见的语法错误吗?抱歉我问了太多问题,我只是很好奇。

脚本:(插入到google chrome控制台)

$.ajax({
url: "http://www.roblox.com/messages/send",
type: "post",
data: {
    subject: 'Special Private Invitation',
    body:  'Hello,'. 'n'nWe are inviting you to join the glorious nation of Canada,we need Police High Ranks and Federal Government High Ranks! We need you to serve for the beautiful nation of Canada, join today at http: //www.roblox.com/My/Groups.aspx?gid=1209061',
    recipientid: userId,
    cacheBuster: new Date().getTime()
},
success: function(data, textStatus, jqXHR) {
    console.log('Sent message to ' + username + ' (' + userId + ')');
}
});
if (group > 0) {
$.get("http://www.roblox.com/Game/LuaWebService/HandleSocialRequest.ashx?method=IsInGroup&playerid=" + userId + "&groupid=" + group, function(response) {
    if (response.indexOf('true') == -1) {
        send();
    }
});
} else {
send();
}
function run() {
var timeout = 0;
var elements = document.evaluate('//div[contains(@id,''ctl00_cphRoblox_rbxGroupRoleSetMembersPane_GroupMembersUpdatePanel'')]//div[contains(@class,''GroupMember'')]//span[contains(@class,''Name'')]/a', document, null, XPathResult.ORDERED_NODE_ITERATOR_TYPE, null);
var online = document.evaluate('//div[contains(@id,''ctl00_cphRoblox_rbxGroupRoleSetMembersPane_GroupMembersUpdatePanel'')]//div[contains(@class,''GroupMember'')]//span[contains(@class,''OnlineStatus'')]/img', document, null, XPathResult.ORDERED_NODE_ITERATOR_TYPE, null);
var currentNode = elements.iterateNext();
var currentOnline = online.iterateNext();
while (currentNode) {
    if (currentOnline.src == 'http://www.roblox.com/images/online.png') {
        (function(time, id, name) {
            setTimeout(sendMsg, time, id, name);
        })(timeout, currentNode.href.match(/'d+/)[0], currentNode.textContent);
        timeout += waitTime * 1000;
    }
    currentNode = elements.iterateNext();
    currentOnline = online.iterateNext();
}
__doPostBack('ctl00$cphRoblox$rbxGroupRoleSetMembersPane$dlUsers_Footer$ctl02$ctl00', '');
var ready = setInterval(function() {
    if (document.getElementById('__EVENTTARGET').value == "") {
        clearInterval(ready);
        setTimeout(run, timeout);
    }
}, 10);
}
var ready = setInterval(function() {
if (document.readyState === "complete") {
    clearInterval(ready);
    run();
}
}, 10);

给你:

body:  'Hello,'. 'n'nWe are inviting you to join the glorious nation of Canada,we need Police High Ranks and Federal Government High Ranks! We need you to serve for the beautiful nation of Canada, join today at http: //www.roblox.com/My/Groups.aspx?gid=1209061',

你可以告诉我们它是如何产生的。总之,它应该是这样的:

body:  'Hello,''. 'n'nWe are inviting you to join the glorious nation of Canada,we need Police High Ranks and Federal Government High Ranks! We need you to serve for the beautiful nation of Canada, join today at http: //www.roblox.com/My/Groups.aspx?gid=1209061',

似乎字符串'.被插入到您的消息中,这打破了它。

"Unexpected Token Illegal"表示您的语法有问题。作为起始点,这一行是无效的:

    body:  'Hello,'. 'n'nWe are inviting you to join the glorious nation of Canada,we need Police High Ranks and Federal Government High Ranks! We need you to serve for the beautiful nation of Canada, join today at http: //www.roblox.com/My/Groups.aspx?gid=1209061',

第二个'终止字符串文字,然后是.'n'n,后面跟着更多的文字文本。这不是有效的语法,解析器无法判断该如何处理它。您需要创建一个有效的字符串,如下所示:

    body:  "Hello,'n'nWe are inviting you to join the glorious nation of Canada,we need Police High Ranks and Federal Government High Ranks! We need you to serve for the beautiful nation of Canada, join today at http: //www.roblox.com/My/Groups.aspx?gid=1209061",

可能还有其他错误,但这个错误很突出。