1. Error description
Synchronous XMLHttpRequest on the main thread is deprecated because of its detrimental effects to the end user's experience.
For more help, check http://xhr.spec.whatwg.org/.
Get the first value: undefined
Uncaught Error: Error calling method on NPObject.
Uncaught
Error: Error calling method on NPObject.
2. Error reason
function windowOnload() {
Report.LoadFromURL("student.grf?date="+(new Date().getTime()));
$.ajax({
url:"param/isPrint",
type:"get",
dataType:"json",
async:false,
}).done(function(resp){
if(dt.success==false){
return;
}
var isPrint=resp.isPrint;
$.ajax({
url:"student/stu/findStu",
type:"get",
dataType:"json",
data:{},
async:false
}).done(function(data){
if(!data){
return;
}
var report = JSON.stringify(data);
Report.LoadDataFromAjaxRequest(report,"application/json;charset=UTF-8");
Report.Print(isPrint);
});
});
}
When making Report by Grid++Report, whether to open the print window is controlled by a parameter isPrint; When isPrint=true, the print window is displayed, otherwise it is not displayed. However, if the query results do not have this parameter and are used directly in Print(isPrint), an Error Error will be reported calling method on NPObject
3. Solutions
Add the judgment before report.print (isPrint) USES this parameter
function windowOnload() {
Report.LoadFromURL("student.grf?date="+(new Date().getTime()));
$.ajax({
url:"param/isPrint",
type:"get",
dataType:"json",
async:false,
}).done(function(resp){
if(dt.success==false){
return;
}
var isPrint=resp.isPrint;
$.ajax({
url:"student/stu/findStu",
type:"get",
dataType:"json",
data:{},
async:false
}).done(function(data){
if(!data){
return;
}
var report = JSON.stringify(data);
Report.LoadDataFromAjaxRequest(report,"application/json;charset=UTF-8");
Report.Print(isPrint?true:false);
});
});
}
Read More:
- Iterator calling next method: Stopiteration [How to Solve]
- CUDA error: CUBLAS_STATUS_NOT_INITIALIZED when calling `cublasCreate(handle)`
- [Solved] RuntimeError: CUDA error: CUBLAS_STATUS_ALLOC_FAILED when calling `cublasCreate(handle)`
- Error calling function %s at New Error
- [Solved] Internal error occurred: failed calling webhook “validate.nginx.ingress.kubernetes.io”:
- [AWS] Solve Error: An error occurred (AccessDenied) when calling the CreateMultipartUpload operation: Access Denied
- Calling Dubbo Service reported the following error (com.alibaba.dubbo.remoting.RemotingException) Causes and Solutions
- [Solved] Rancher Add User Error: x509: certificate has expired Internal error occurred: failed calling webhook “rancherauth.cattle.io”:
- Vue: How to Solve Error uncaught (in promise) cancel
- [Solved] Kubernetes ingress-srv. error: failed calling webhook “validate.nginx.ingress.kubernetes.io”
- [Solved] Eval Error: Uncaught ReferenceError: False is not defined
- Uncaught SyntaxError: Cannot use import statement outside a module
- C++ Error: terminating with uncaught exception of type std::out_of_range: vector Abort trap: 6
- [Solved] Uncaught ReferenceError: FileAsyncWriter is not defined
- [Solved] HTML_Uncaught SyntaxError: Cannot use import statement outside a module
- [Solved] Uncaught ReferenceError: is not defined at HTMLAnchorElement.onclick
- [Solved] Vue Error: Uncaught TypeError: Cannot read property ‘getters‘ of undefined
- [Solved] Vue + uniapp Uncaught TypeError: Cannot read property ‘getters‘ of undefined
- vue VM682:1 Uncaught SyntaxError: Unexpected token u in JSON at position 0
- Refresh 404 after packaging Vue project, uncaught syntax error: unexpected token <