jquery报错: "object expected"
来源:互联网 发布:双层玻璃杯 知乎 编辑:程序博客网 时间:2024/04/25 09:10
*****************************************************
************** jquery报错: *******************
*****************************************************
1. "object expected"错误: 是jquery库的引用方式不对引起的。
错误的引用方式: <script src="/js/jquery-1.3.2.min.js" type="text/javascript"> </script>
正确的引用方式: <script language="javascript" type="text/javascript" src="../js/jquery-1.3.2.js"> </script>
另外包含js脚本的语法写法如下(书写不标准也会报错"object expected"):
<script language="javascript" type="text/javascript"> </script>
2.Jquery在vs2005和vs2008中的语法也有很大不同(应用时要稍加注意),比如:
//无参数调用
$(document).ready(function() {
$('#btn1').click(function() {
$.ajax({
type: "POST",
contentType: "application/json",
url: "MyWebService2.asmx/HelloWorld",
data: "{}",
dataType: 'json',
success: function(result) {
$('#dictionary').append(result); ****** 注释:vs2005回调函数中获取返回值的方式。
}
});
});
});
//无参数调用
$(document).ready(function() {
$('#btn1').click(function() {
$.ajax({
type: "POST",
contentType: "application/json",
url: "WebService1.asmx/HelloWorld",
data: "{}",
dataType: 'json',
success: function(result) {
$('#dictionary').append(result.d); ****** 注释:vs2008回调函数中获取返回值的方式。
}
});
});
});
************** -------- end -------- *******************
- jquery报错: "object expected"
- dojo 函数报错 object expected
- [已解决]Object c,报错Expected method body
- 报错expected statement
- jquery ajax 报错:[Object XMLHttpRequest]
- object-c c case语句中的报错 Unexpected interface name 'NSArray': expected expression
- linux下scala脚本运行报错error: expected class or object definition 解决方案
- spark 报错ypeError: expected string or Unicode object, NoneType found
- Object expected
- IE下使用uploadify上传报:Uploadify-Script5007 Object expected
- expected identifier 报错怎么办?
- Expected identifier or'('报错
- jquery file upload报错 TypeError: Object [object Object] has no method 'progressbar'
- IE7 下执行jquery, 报错IE error: Expected identifier, string or number 的解决办法
- React native 安卓上传图片报错 TypeError:expected dynamic type 'string' but had type 'object'
- 脚本报错: binary operator expected
- AFJSONRequestOperation报错Expected content type
- Django报错expected string or buffer
- 工作VS爱情
- 《PHP和MySQL Web开发》笔记之使用PHP(一)
- QT源码解析(三)深入剖析QT元对象系统和信号槽机制(续)
- 创建透明表时的细节
- 分页机制代码详细注释
- jquery报错: "object expected"
- 发NEC中国研究院实习生面经
- 公司简介
- Trac安装指南
- (企业)销售货运代理,国内外运输及代理服务费
- ubuntu 下minicom的安装及使用
- 12-Dec-2009
- tomcat数据库连接池配置
- http 路径