未捕获的SyntaxError:意外令牌非法控制台
Uncaught SyntaxError: Unexpected token ILLEGAL console
好的,抱歉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",
可能还有其他错误,但这个错误很突出。
相关文章:
- React JS:未捕获(在承诺中)语法错误:在位置 0 的 JSON 中意外<令牌
- jQuery$.getJSON抛出意外令牌
- 为什么我在下面的..of循环中得到意外令牌
- 组件中的ReactJS意外令牌
- AngularJS $http GET 请求到本地 JSON 文件返回语法错误:意外令牌]
- 巴别塔,意外令牌 (15:33) ::.
- Sencha 2.0 和 Codeigniter RESTful API 生成未捕获的语法错误:意外令牌:
- 在事件上使用 jquery 时出现意外令牌
- JSON 中位置 4 处的意外令牌<
- 意外令牌 ) 在我的代码中
- Electron 和 Babel 6 异步/等待抛出意外令牌
- “JSON.parse(str)”返回“意外令牌c”,但str是一个字符串
- jQuery after() uncatch SyntaxError: 意外令牌 ILLEGAL
- 使用节点javascript的意外令牌ILLEGAL
- Javascript/JQuery-Chrome意外令牌
- Ajax 帖子未捕获语法错误:意外令牌非法
- angularjs-SyntaxError:请求从服务器返回时出现意外令牌
- jquery:使用ember的意外令牌C
- React本机项目中的意外令牌
- 解析有效的 JSON 得到“语法错误:意外令牌非法”