I dont think you should call JSON.parse(jsonObject)
if the server is sending valid JSON as it will be parsed automatically when it retrieves the response. I believe that if You set the Content-type: application/json
header it will be parsed automatically.
Try using jsonObject
as if it was already parsed, something like:
console.log(jsonObject.canApprove);
Without calling JSON.parse
before.
Related Posts:
- jQuery AJAX cross domain
- React Js: Uncaught (in promise) SyntaxError: Unexpected token < in JSON at position 0
- SyntaxError: JSON.parse: unexpected character at line 1 column 1 of the JSON data
- “NS_ERROR_DOM_BAD_URI: Access to restricted URI denied”
- Cross-Origin Read Blocking (CORB)
- What is JSONP, and why was it created?
- TypeError: Converting circular structure to JSON in nodejs
- Use a JSON array with objects with javascript
- Chrome sendrequest error: TypeError: Converting circular structure to JSON
- Fetch: POST JSON data
- Uncaught SyntaxError: Unexpected token u in JSON at position 0
- Unexpected token u in JSON at position 0 (but only sometimes)
- How to read an external local JSON file in JavaScript?
- SyntaxError: Unexpected token o in JSON at position 1
- SyntaxError: Unexpected token o in JSON at position 1
- What is the convention in JSON for empty vs. null?
- What is the “right” JSON date format?
- Nested JSON objects – do I have to use arrays for everything?
- Uncaught TypeError: Cannot read property ‘length’ of undefined
- What is the “right” JSON date format?
- ajax jquery simple get request
- jQuery get textarea text
- Response to preflight request doesn’t pass access control check
- How to compare arrays in JavaScript?
- Failed to load resource: net::ERR_FILE_NOT_FOUND loading json.js
- Send POST data using XMLHttpRequest
- Set timeout for ajax (jQuery)
- How to generate a simple popup using jQuery
- What does on() in JavaScript do?
- SyntaxError: Unexpected token o in JSON at position 1
- jQuery AJAX submit form
- jQuery Ajax File Upload
- How can I upload files asynchronously with jQuery?
- Adding images to a Bootstrap Carousel with AJAX
- Uncaught TypeError: Cannot read property ‘props’ of null
- AJAX response error: net::ERR_EMPTY_RESPONSE
- How to convert JSON object to JavaScript array?
- Disable same origin policy in Chrome
- Access Control Request Headers, is added to header in AJAX request with jQuery
- Uncaught TypeError: data.push is not a function
- How to convert selected HTML to Json?
- Can JavaScript connect with MySQL?
- XMLHttpRequest status 0 (responseText is empty)
- Basic Ajax send/receive with node.js
- How to get JSON from URL in JavaScript?
- How do you put an image file in a json object?
- Refused to execute script, strict MIME type checking is enabled?
- Refresh/reload the content in Div using jquery/ajax
- TypeError: res.json is not a function
- How does AJAX work?
- SyntaxError: Unexpected token C in JSON at position 0 – Ionic 2 Http GET request
- SyntaxError: JSON.parse: unexpected end of data at line 1 column 1 of the JSON data
- Add new attribute (element) to JSON object using JavaScript
- Scroll to bottom of div?
- How to display raw JSON data on a HTML page
- Convert array to JSON
- How to manage a redirect request after a jQuery Ajax call
- JSON.stringify (Javascript) and json.dumps (Python) not equivalent on a list?
- How to allow CORS in react.js?
- How to add a button dynamically using jquery
- Using setTimeout on promise chain
- FormData append not working
- Complex JSON nesting of objects and arrays
- Uncaught TypeError: Cannot read property ‘toLowerCase’ of undefined
- How can JavaScript save to a local file?
- Download a file by jQuery.Ajax
- What is ‘xmlhttp.setRequestHeader();’ and in which situations is it used?
- Write / add data in JSON file using Node.js
- How do I handle newlines in JSON?
- Finding the max value of an attribute in an array of objects
- Defining a HTML template to append using JQuery
- Ajax success function
- JAX post error : Refused to set unsafe header “Connection”
- AngularJS POST Fails: Response for preflight has invalid HTTP status code 404
- What are the differences between JSON and JSONP?
- WP Rest API – How to get featured image
- Implementing Isomorphic JavaScript (React JS) in WordPress?
- How to use wp_localize_script in custom page template?
- Allowing admin-ajax.php to receive “application/json” instead of “x-www-form-urlencoded”
- Can’t get a JSON object in response to an Ajax request with wp_ajax
- How to Use JSON With AJAX?
- Does wp_localize_script call a Javascript Function or Simply Pass PHP Parameters to It
- Dynamically insert values in a WordPress SelectControl Options field
- 404 Error Contact Form 7 on WordPress
- Base64 & JSON Encode array in PHP, use as HTML data attribute, decode and parse in JavaScript …. with proper Escaping
- AngularJS with route and JSON API
- Pass data from wordpress to javascript in JSON
- How to make wordpress URLS google friendly for ajax driven sites?
- AJAX not Working with php as supposed
- How to include a JSON file on my page?
- Why WordPress not using JSON_UNESCAPED_UNICODE by default?
- how to use nimble-API and Display data?
- Remove escape characters from JSON string pulled from a database
- I would like to retrive JSON value and display it in wordpress page or widget
- Ajax WordPress pass post URLs
- How to avoid appending “null” in Ajax?
- Connecting a wordpress site to an AngularJS APP
- Why wp_ajax hooks doesn’t work?
- Pass a PHP variable (loop-audio.php) to jQuery function (js/script.js)
- Gutenberg core/file add style support in js/ json