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:
// 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.
}
});
});
});
Statement: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