Run a code first

0

Good morning .. When I press any MENU, BUTTON, link, etc. everything works correctly and perfectly, however, it has hours that the code to be executed takes, sometimes a little, sometimes more than a little. This bothers me a lot because I do not know if I clicked, so I click again. This feeling should be the same as a user. So what I'd like to do is make an hourglass appear BEFORE EVERYTHING. The hourglass / wait I already know how to do. I use this way:
link

On some buttons on the onclick calling a function I "trigger" the AMPULETER / WAIT APPEARANCE, and at the end of the function execution I "SHOOT" the AMPULETER / WAIT. With this if I am processing something on the server or a more time-consuming task, I show the user that something is happening ... and when the task is finished the hourglass disappears and the user knows he can continue. What I would like to learn to do is when I click on an exe menu item:

<li><a href='especialidade_01.php'>Especialidades</a></li>");

This page of this menu item already comes with the AMPULHETA / AGUARDE "loaded" and at the end of the "loading" page "TAKE" the "AMPULHETA / AGUARDE". There are times that I click on a menu item and the page takes to appear .. very annoying. Sorry for the words / terminology I used to report but I really do not know how to call / describe this situation properly due to lack of experience ..

    
asked by anonymous 14.11.2017 / 16:34

1 answer

0

no <body> you can put onload with this function

<body onload="nomeDaFuncao()">

Serve?

    
14.11.2017 / 16:45