When sending an Ajax request, if there is no corresponding file content in the requested file, or if the path is wrong, the page will report an error. Here’s a brief introduction, such as how to avoid page error reporting, or page compatibility
xhr.onreadystatechange = function() {
if(xhr.readyState == 4) {
//Verify that the file is available, using status to determine the status
if(xhr.status >= 200 && xhr.status < 300 || xhr.status == 304) {
box.innerHTML = xhr.responseText;
}else {
// Error page, server error or not found error
console.error("Error Request")
}
}
}
This page will not appear the following error problem
The error will be output on the console
Read More:
- [Solved] Cannot read properties of undefined (reading ‘ajax‘); Cannot read property ‘ajax‘ of undefined
- The Ajax return value reports an error, and the spring boot development Ajax return value reports an error
- WordPress update failed 429 too many requests (How to Fix)
- Spark ERROR client.TransportResponseHandler: Still have 1 requests outstanding when connection from
- Eclipse start project error: Errors occurred during the build. Errors running builder ‘Integrated External Tool Builder’ on…
- DataTables warning encountered using DataTables: table id = DataTables_Table_0 – Ajax error. For more information ab
- [Solved] removeerror: ‘requests’ is a dependency of CONDA and cannot be removed from
- Nginx: How to Use Error_Page
- The index.nvue page of uniapp reports an error about CSS
- [Solved] ELK Log System Error: “statusCode“:429,“error“:“Too Many Requests“,“message“ Data too large
- SSM custom 404 and 500 error reporting interface
- The drone settings page is not trusted
- [Solved] MindSpore Error: “RuntimeError: Invalid data, Page size.”
- [Solved] ERROR #8003 More than one page is numbered 1.
- [Solved] IEEE contribute error: Page n has margin implications
- The page you are requesting cannot be served because of the extension configuration
- [Solved] Swagger Error: Whitelabel Error Page status=405
- Download and save uniapp pictures to Android error reporting app
- Solution of socket write error caused by pressing F5 to refresh page by ehcache user
- Hive 3.1.2 startup error reporting and resolution of guava version conflict