It was a cookie issue. The domain of the website I was using had changed between writing the code and adding this new functionality. The cookies were stored with the new domain, but the code was loaded a page with the old domain. It routed to the page, but then failed to load via on click because the website domain did not match the domain stored in the cookies.