'Uncaught SyntaxError: Unexpected token o in JSON at position 1 I have this exception but I don´t know what is this
some errors on Chrome after run my jsp, I don't know what happens:
adblock-onpage-icon-cs.js:172 Uncaught ReferenceError: browser is not defined
at onScriptLoad (adblock-onpage-icon-cs.js:172)
at adblock-onpage-icon-cs.js:183globalstorage:1
Uncaught SyntaxError: Unexpected token o in JSON at position 1
at JSON.parse (<anonymous>)
at handleRequest (globalstorage:47)
This is the code in js but, the but I can't understand the mistake.
$(document).ready(function() {
alert("json");
$.ajax({
//connect to a Servlet
url: "ServletReportes",
type:"POST",
dataType:"json",
success: function( result ) {
console.log(result);
}
});
});
Solution 1:[1]
Just in case it helps someone else, the first error has nothing to do with your code. This error shows sometimes when you have the adblock extension installed on your browser.
It is often fixed just by uninstalling and installing again the extension, otherwise you can dismiss the error as should not affect your code.
The second error also does not seem an error in your code but in the response, probably the response of the ajax call not being a valid JSON format.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Carlos Ruana |
