未捕获到的SyntaxError:意外令牌. [英] Uncaught SyntaxError: Unexpected token .
本文介绍了未捕获到的SyntaxError:意外令牌.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我是JQuery的新手.
我正在页面中实现以下jquery脚本.
I am new to JQuery.
I am implementing the following jquery script in my page.
<script type="text/javascript">
(function($) {
$(document).ready(function() {
.sampleConfirm({text: 'Are You Sure You Wish To Delete This item ?',
yText: 'Yes',
nText: 'No',
title: 'Confirm'
});
});
}(jQuery));
</script>
当我在Chrome中运行我的页面时,出现了问题
when i am running my page inside the chrome it is giving the problem
Uncaught SyntaxError: Unexpected token .
在第三行
为什么我会收到此错误.
谢谢...
at 3rd line
Why i am getting this error.
Thank you...
推荐答案
){
(文档).ready(函数(){ .sampleConfirm({text:' 您确定要删除此项目吗?', yText:' 是', nText:' 否', 标题:' 确认' }); }); }(jQuery)); < / 脚本 >
(document).ready(function() { .sampleConfirm({text: 'Are You Sure You Wish To Delete This item ?', yText: 'Yes', nText: 'No', title: 'Confirm' }); }); }(jQuery)); </script>
当我在Chrome中运行我的页面时,出现了问题
when i am running my page inside the chrome it is giving the problem
Uncaught SyntaxError: Unexpected token .
在第三行
为什么我会收到此错误.
谢谢...
at 3rd line
Why i am getting this error.
Thank you...
为什么要在sampleConfirm前面使用点(.).如果这是扩展名或functin,则应仅使用sampleConfirm来调用它,而不能使用前导点.
问候
Why are you using a dot (.) in front of sampleConfirm. If this is an extension or functin then you should be calling it using just sampleConfirm without a leading dot.
Regards
这篇关于未捕获到的SyntaxError:意外令牌.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文