REST API looking for complete sample javascript example
-
Hi I’m attempting to create a single page application that deals with uploading photos. Outside of WordPress I’ve not having a problem. However I want the single page application to run inside WordPress and end up with the photo (image file) within wp-content. Thus, I’m looking for an end to end use case example of using WordPress REST API for a single page application written in JavaScript.
Coding style- ES6 – modern JavaScript is good
- No JavaScript frameworks, use Backbone if that is the only way
- Assume modern browser, e.g. latest Google Chrome
Flow
- User has logged into WorkPress normally, that is using site GUI, thus there should be a cookie or something to use for security
- User clicks on a URL that goes to a page on the same site, which is the single page application. Thus, there is probably an html page somewhere
- This is what I’m looking for >> This page does a very basic REST API call, for example, lists the last 5 posts. This can be so simple, that only Javascript console.log() is used to print something
Thats all. You’re thinking all of these parts are documented elsewhere. While the parts might be, I’ve yet to find an example that is end to end complete.
Thanks for helping
CCC
The topic ‘REST API looking for complete sample javascript example’ is closed to new replies.