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