Sam Henrichs Sam Henrichs - 7 months ago 20
HTML Question

How to make a page reload when it is visited

I have a rails app the problem is that when I visit a new page, the page doesn't load properly, which makes my JQuery ineffective. You can visit the site, and see what I mean. Here is my JQuery:

$('document').ready(function() {


$('#caret').click(function() {

if($('.dropdown-services').is(":visible")) {
else {


Here is my navbar's code:

<div class="navbar">

<div class="box first">
<a href="/pages/home" class="link-disabled">HR4D</a>

<div class="box second">
<span class="tagline">Define, Develop, Deliver, and Differentiate</span>

<a class="link" href="/pages/home">

<a class="left link" id="services" href="/pages/services">
<div class="caret" id="caret"></div>

<a class="left link" href="/pages/contact">
Contact Us

<a class="left link" href="/pages/about">



Not sure how to fix this problem. Any help is appreciated.


The problem is largely caused by Turbolinks. One way I've often worked around it, is to disable Turbolink entirely or disable it for specific portions of your code. To disable globally, in your app/assets/javascripts/application.js you could remove the line that requires the turbolinks.