Uncaught URIError: URI malformed
- url, pass the value, if the key has Chinese characters inside, the browser will be encoded off by default, so this page needs to be decoded first when calling the query interface), the above error occurs.
- Because the url contains the “%” character, the browser will give an error when it executes decodeURIComponent on “%”.
Repeat the problem
The browser url on the splice on (?q=%好的
);
https://www.baidu.com/?q=%好的
Enter the code;
location.search
'?q=%%E5%A5%BD%E7%9A%84'
decodeURIComponent('%%E5%A5%BD%E7%9A%84');
Solution
urlStr.replace(/%/g, '%25');
Fundamentally solve the problem: encode the URL before uploading the value
encodeURIComponent('%好的');
'%25%E5%A5%BD%E7%9A%84'
https://www.baidu.com/?q=%25%E5%A5%BD%E7%9A%84
Read More:
- [Solved] Uncaught SyntaxError: Invalid Unicode escape sequence
- [Solved] Uncaught SyntaxError: Cannot use import statement outside a module
- [Solved] Uncaught SyntaxError: Unexpected token ‘<‘
- Uncaught (in promise) NavigationDuplicated: Avoided redundant navigation to crrent location: “/home“
- [Solved] ajax Error: Uncaught SyntaxError: Unexpected end of JSON input
- [Solved] Uncaught SyntaxError: The requested module does not provide an export named
- [Solved] Uncaught ReferenceError: axios is not defined
- [Solved] react Chrome Browser Error: Uncaught TypeError: Cannot read properties of undefined (reading ‘forEach‘)
- vue Error: Uncaught SyntaxError: Invalid shorthand property initializer
- [Solved] JS Error: Uncaught SyntaxError: Illegal return statement
- [Solved] electron Error: Uncaught TypeError: Cannot read property ‘BrowserWindow‘ of undefined
- Vue Error: Uncaught (in promise) NavigationDuplicated: Avoided redundant navigation to current location
- [Solved] Uncaught (in promise) Error: Avoided redundant navigation to current location:
- [Solved] Uni.createintersectionobserver Error: Uncaught TypeError: Cannot read property ‘bottom’ of null
- [Solved] Uncaught Error: @electron/remote is disabled for this WebContents
- [Solved] JS Error: Uncaught TypeError: Cannot set properties of null (setting ‘innerHTML‘)
- JS bug Log Uncaught TypeError: Cannot read property ‘previoustSibling‘ of null
- How to Solve Uncaught (in promise) Error (Two Solutions)
- [Web Browser] “Uncaught TypeError: object is not a function“
- [Solved] Uncaught DOMException: Failed to execute ‘readAsDataURL‘ on ‘FileReader‘: The object is already busy