wp_send_json erase last value

You don’t need to specify datatype in your AJAX call. Also, WP handles AJAX a bit differently, primarily: $(‘#filter_evenement’).submit(function(){ jQuery.ajax({ url:ajaxurl, type:”POST”, data : {action: “evenements_filter_function”, val1: “value1”, val2: “values2”}, success:function(data){console.log(data); var dataArray = jQuery.parseJSON(data);//parse JSON }, fail: function( jqXHR, textStatus, errorThrown ) { } }); }); data has to contain action which specifies the … Read more

I would like to retrive JSON value and display it in wordpress page or widget

I found some articles on net on how to proceed, tried this code: $url=”https://api.crex24.com/CryptoExchangeService/BotPublic/ReturnTicker?request=[NamePairs=BTC_BZK,BTC_DOGE]“; // path to your JSON file $data = file_get_contents($url); // put the contents of the file into a variable $characters = json_decode($data); // decode the JSON feed echo $characters[0]->PairName; foreach ($characters as $character) { echo $character->PairName . ‘‘; }