Access Template Tag result from JavaScript File
-
I have a WordPress site built using HTML/JS/CSS, not WordPress templates or blocks. I am mainly using WordPress as an admin tool – access restrictions, subscription levels, database storage, etc. I am trying to access the API I am using (ERPLY API – https://learn-api.erply.com), and when tested in the plugin, everything returns as normal.
However I am struggling to put that data into my JavaScript file, which is running through a plugin, as separate pages need different levels of access to the JavaScript. What is the method you would recommend to access the results of an API call in a separate JavaScript file? Is that possible to do using the template tag/ajax?
A code example would be greatly appreciated too, as I do not have much experience in PHP/AJAX – and please let me know if you need any more information, I am happy to provide it.
- The topic ‘Access Template Tag result from JavaScript File’ is closed to new replies.