I encountered two problems when using the panel's loader property:
1) If the url in ajax is wrong, how do I use the function 'error' and give an error message? I tried to solve it in the onLoadError event, but it didn't work.
2) When using the loader, I must also set a url that is not empty, otherwise Ajax will not make a request.
These two questions are puzzling and ask for help. Thank you!
Here is the sample code:
$('#test').panel({
title: 'mytitle',
width: 300,
height: 100,
href:' ', //The href attribute cannot be empty, otherwise the loader is invalid.
queryParams:{
v1:'abc'
},
loader:function(para,success,error){
$.get('test1.php',para,function(data){
success(data)
//If the request is wrong, how can I call the error function and give a prompt message?
})
}
})