Home > Web Front-end > JS Tutorial > body text

Solution to jquery prompt 'object expected'_jquery

WBOY
Release: 2016-05-16 18:39:36
Original
1470 people have browsed it

1. "Object expected" error: It is caused by the incorrect reference method of the jquery library.
Incorrect citation method:
Correct citation method: < ;script language="javascript" type="text/javascript" src="../js/jquery-1.3.2.js">
In addition, the syntax for js scripts is as follows (writing If it is not standard, an error "object expected" will be reported):

2. Jquery also has syntax in vs2005 and vs2008 Big difference (pay some attention when applying), for example:

Copy code The code is as follows:

// Call without parameters
$(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); ****** Note: How to get the return value in the vs2005 callback function
}
}. );
});
});

//Call without parameters
$(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); ****** Note: How to get the return value in the vs2008 callback function.
}
});
});
});
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template