Adds AJAX called flag to prevent redundant refresh of AJAX request

To handle the browser back button, the AJAX script needs to listen for
when the history's popstate is fired, and respond when the back button
is clicked on a page that uses AJAX. This led to a redundant call to
the AJAX request when the page first loaded. This commit adds a flag
that is set to false initially.