Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
* Fetch the Members locations using AJAX
* The action sent to the WordPress router is: woffice_map_members
fetchLocations: function () {
var self = this;
url: this.url,
type: 'POST',
data: {
action: 'woffice_map_members',
_nonce: this.nonce,
success: function (data) {
if (data.length === 0) {
// We parse it from JSON to an Array
var returnedMembers = JSON.parse(data);
// We don't add it if there is any error
if (returnedMembers.error !== undefined) {
self.members = returnedMembers;
// Let's draw the markers
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.