Div wrap entire page

I tried to div wrap a page and replace its content with a link to # so I could click the link to make the whole page appear with jquery Should I be able to do that regardless what's on the page, cause it doesn't seem to wanna work

When JavaScript does not work, you need to immediately suspect whether your rendered HTML is valid, and whether the HTML exists in the browser's "mind" at the moment it is evaluated. Open the Developer Tools console in your browser, click on the element, and look at the result of your request, if any. If you don't see a request, then suspect that your JavaScript is not properly bound to the page element you think it is. If you are rendering this JS with the asset pipeline, then remember that your script will appear (in source order) before the HTML it refers to, so you MUST use lazy-evaluation techniques to find the thing you want to listen to, otherwise your listener will not be bound to an element, and it will fail silently. In jQuery, that would be $(document).on('click', 'some CSS selector', function(){ .. do something here .. }); If you have inlined your script below the HTML it refers to, then you have a different problem, and without an example of the rendered HTML to look at here, I can only tell you where to start poking.

You should not need a link; if you have an ID on the div you want to "re-fill", then just a click on that div should be enough.

$(document).on('click', '#some_div', function(){

path/to/route would be whatever URL you would hit in your app to get the content you want to use to re-fill the div. The 'load' method is a shortcut for $('#elm').html = $.get('some url').

If you do have a link to #, then remember that link will be followed unless you stop it in your click handler. You don't need to worry about that when you bind a regular click handler to a non-link element.