If you're interested in adding real-time wait times to your website, you'll need to use our wait time JavaScript code. Follow the steps below to install it on your website.
1. Load the jquery library first.
This allows the JavaScript to execute properly.
Below is sample script to load jQuery. You can also choose a different version here, but make sure it's a more recent version or it will not work properly. Make sure to place it above the first-available-time script.
<script src="https://code.jquery.com/jquery-3.5.1.min.js" integrity="sha256-9/aliU8dGd2tb6OSsuzixeV4y/faTqgFtohetphbbj0=" crossorigin="anonymous"></script>
2. Add the wait time JavaScript.
If you've installed our first-available-time JS code before, you'll recognize the code below as looking very similar. There are two differences however:
-
- A different endpoint URL (ex: https://apps10.erexpress.com/erx-reservationform/api/adjustedWait/100003?callback= ?)
- "data.ReservationTime" is changed to "data.adjustedWait"
<script type="text/javascript">
$ ( function() {
$.getJSON("https://apps10.erexpress.com/erx-reservationform/api/adjustedWait/facilityID?callback=?", function( data )
{
$('#divID').html("<p style='margin-bottom: 0; line-height:10px;'> Wait Time: " + data.adjustedWait + "</p>");
});
});
</script>
<div id="divID"></div>
3. Plug in your facilityID and divID.
You will need to do this for each facility that needs wait times displayed.
-
- facilityID: We will provide this to you. Please plug this in in place of the highlighted text once you receive the ID(s).
- divID: Customize by facility. Please plug in a unique name. For example, if the facility is named GetWell Fairfield Urgent Care, you might label this as Fairfield.
4. Test & debug the script.
-
-
- We recommend doing a test implementation using our fictional test clinic, Milford Urgent Care. Its facilityID is 100004.
- Once you copy the script, run it through a script cleaner since this document has likely added carriage returns, etc. We recommend: https://html-cleaner.com/js/
- We recommend using jsFiddle (https://jsfiddle.net/) to debug because it lets you first isolate retrieving the wait time without trying to publish it in HTML.
- New to jsFiddle? Here's a few tips:
- Add the jQuery library
- You can then paste your own facilityID (which ER Express will provide)
- Once you click run (upper left corner), it will publish the wait time in the console log
-
You can see a live real-time example with the first available time slot published to the console here: https://jsfiddle.net/spatelerx/1aczujq9/1/
Have more questions? Submit a request