0
I am trying to show a loading image on my pages using these functions:
$(document).ready(function(){
$(".loading").hide();
$.unblockUI();
$(".menuLink").focus(function() {
$(this).addClass('link-menu-selected');
});
$(".menuLink").blur(function() {
$(this).removeClass('link-menu-selected');
});
});
$(window).bind('beforeunload',function(){
$(".loading").show();
$.blockUI({message: null});
});
function exportFile(){
$('.loading').hide();
$.unblockUI();
}
But, the image does not appear, IE, the pages are loading correctly without displaying the image, someone knows what would be wrong, or if there are other ways to perform this ?
No error appears in the console, I put it in my main JS loading, a single JS where I centralize all my functions.
There are other ways of doing this in an efficient way ?
I add the following "libraries" as well:
<script type="text/javascript" src="/sign/resources/js/jquery-1.9.1.min.js"></script>
<script type="text/javascript" src="/sign/resources/js/jquery.blockUI.js"></script>
<script type="text/javascript" src="/sign/resources/js/renderAjax.js"></script>
I add this there is a template page, "header", that all pages of my application use:
<ui:composition template="/layout/template.xhtml"
xmlns="http://www.w3.org/1999/xhtml"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
That is, I wanted to do it in a generalized way, in a way that all the pages of my application would inherit this "Wait" function, thus displaying this image.
I want to do this, but not in php, in JSF2:
https://stackoverflow.com/questions/3535020/show-image-while-page-is-loading
Which error message appears in the browser log? Run the page and click F12 and post the error message here
– Paulo Roberto
Post the full code so we can test everything.
– Paulo Roberto
This is the complete code, the only thing there is more to this function is to add the following "libraries" js <script type="text/javascript" src="/Sign/Resources/js/jquery-1.9.1.min. js"></script> <script type="text/javascript" src="/Sign/Resources/js/jquery.blockUI.js"></script> <script type="text/javascript" src="/Sign/Resources/js/renderAjax.js"></script>
– Edson Cezar
I refer to the complete HTML code, that’s just the function, if you post everything there, da to run here and maybe we get the solution.
– Paulo Roberto