JavaScript 问题 - 意外的令牌 (.
javascript issue - unexpected token (
这里的代码假设调用一个文件,该文件将返回用于填写表单的数据,但我收到此错误(在代码中),我不知道为什么。
dropdown.bind('change', function(){
$post.('backgroundScript.php',
Uncaught SyntaxError: Unexpected token ( - this is the error im getting
{
first: dropdown.val()
},
function(response) {
$('#first').val(response.first);
$('#last').val(response.last);
// Repeat for all of your form fields
},
'json'
);
});
如果你能帮我一把,我将不胜感激:)
把 . 在帖子之前而不是之后,感谢Mihai Stancu发现了这一点。
dropdown.bind('change', function(){
$.post('backgroundScript.php',
{
first: dropdown.val()
},
function(response) {
$('#first').val(response.first);
$('#last').val(response.last);
// Repeat for all of your form fields
},
'json'
);
});
尝试使用 "$.post(
而不是 $post.(
相关文章:
- React JS:未捕获(在承诺中)语法错误:在位置 0 的 JSON 中意外<令牌
- 未捕获的语法错误:意外的令牌,
- jQuery$.getJSON抛出意外令牌
- 当其他解析器认为意外的令牌有效时,json.parse会失败
- 意外的令牌模块生成失败:SyntaxError
- 为什么我在下面的..of循环中得到意外令牌
- 意外的令牌非法javascript/metrol
- 三元条件中出现意外的令牌中断
- DynamoDB和Node Js:意外的令牌h
- RegEx中出现意外的令牌错误
- data.php:1未捕获的语法错误:意外的令牌:
- 错误:[$parse:syntax]语法错误:令牌''是意外的令牌
- 组件中的ReactJS意外令牌
- Jquery脚本未在运行时加载编辑:意外的令牌
- 未捕获的语法错误:意外的令牌非法?看起来不错
- "未捕获的SyntaxError:意外的令牌ILLEGAL“;当我通过AJAX发送html时
- 获取意外的令牌ILLEGAL JS错误
- JavaScript-Gulp/Browserify:SyntaxError:意外的令牌
- Jquery .ajax() SyntaxError: 意外的令牌 N.
- AngularJS $http GET 请求到本地 JSON 文件返回语法错误:意外令牌]