This is an example of a javascript loading page that inserts itself between pages. This code is placed on the page before the loading. I used a simple submit button that submits my search query. You can get the ajax loading gif from here:
http://www.ajaxload.info/
<div id="divLoading" style="margin: 0px; padding: 0px; position: fixed; right: 0px;
top: 0px; width: 100%; height: 100%; background-color: #666666; z-index: 30001;
opacity: .8; filter: alpha(opacity=70);display:none">
<p style="position: absolute; top: 30%; left: 45%; color: White;">
Loading, please wait...<img src="../../Content/themes/base/images/ajax-loading.gif">
</p>
</div>
<button type="submit" class="btn btn-success" onclick="JavascriptFunction()"value="filter" name="searchQuery">SUBMIT</button>
<script type="text/javascript" language="javascript">
function JavascriptFunction() {
var url = '@Url.Action("PostMethod", "Home")';
$("#divLoading").show();
$.post(url, null,
function (data) {
$("#PID")[0].innerHTML = data;
$("#divLoading").hide();
});
}
</script>
Basically when the user clicks the submit button, the loader appears until the next method/data/view is loaded.