I recently just solved the issue of outputting foreign characters using utf8_decode function in this thread: How do I convert, display and store this characters in PHP?
It works by directly echoing the results out but now I have this json_encode function to pass to jquery for the results. Json_encode is escaping my data to something like this:
{"title":"\u90ed\u5bcc\u57ce - \u641c\u7d22"}
How do I json_decode from jquery? Thank you for any advice.
jQuery offers the parseJSON
method straight from the jQuery
object:
var data = $.parseJSON('{"title":"\u90ed\u5bcc\u57ce - \u641c\u7d22"}');
For fetching data via AJAX, though, $.getJSON
will run this internally and pass the result of $.parseJSON
as the request's final result.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With