Javascript API

You can reference the reserve in store JS API with the code window.reserveInStore or ris for short.

console.log("Reserve In-store Version: ", ris.version);

This global variable will be available once the system is initialized.

If you're not sure if your code will get run before or after the Reserve In Store app gets initialized, you should use the "push" method of running your code. See the 'push' method.

Example: Alert preferred location upon initialization

window.ris = window.ris || [];
window.ris.push('on', {
  event: 'init',
  callback: function() {
    ris.getLocation(function(location) {
      if (location) {      
        alert("Preferred location is currently set to: "+ location.name);
      } else {
        alert("No preferred location is available.");
      }
    });
  }
});

Last updated