wordpress - JSON API to HTML -


I try to use different instructions to use the JSON API from Wordpress-System in an HTML-teamplate Unfortunately I'm not successful Do anyone have any idea how can I read the "Content" section?

  blog: function () {$ .ajax ({url: 'http://www.earnyour21.de/api/get_page/?id=1588', type: 'GET' , Data type: 'jason', success: function (data) {console.log (data);}, error: function (data) {console.log (data);}}); } If the data structure of JSON is always the same, then you just type the object name in JS Access the object directly by using.  
  blog: function () {$ .ajax ({url: 'http://www.earnyour21.de/api/get_page/?id=1588', type: 'GET' , Data type: 'Jason', success: work (data) {$ ('# content_test'). Append (data ['page'] ['content']);}, error: work (data) {$ (' # Content_test ') .Append (data [' page '] [' content ']);}}); }   

Basically you need to use jquery to capture the div with content_test id and then add your data to json. For further reference.

Comments

Popular posts from this blog

java - ImportError: No module named py4j.java_gateway -

python - Receiving "KeyError" after decoding json result from url -

.net - Creating a new Queue Manager and Queue in Websphere MQ (using C#) -