Please see the above code, it should help you. Also please follow the below link for more informatiom https://developer.wordpress.com/docs/rest-api-javascript/ Best Regards Naga kiran
I would use the awesome ForceTK from Pat Patterson (aka Metadaddy) - this provides access to the REST API for a range of situations, such as Visualforce pages, hybrid mobile apps.
Its available at : https://github.com/developerforce/Force.com-JavaScript-REST-Toolkit
Please see the above code, it should help you.
Also please follow the below link for more informatiom
https://developer.wordpress.com/docs/rest-api-javascript/
Best Regards
Naga kiran
Its available at : https://github.com/developerforce/Force.com-JavaScript-REST-Toolkit