PHP preload loader

Hi,
Is there a preload capability in php where after a user hits a submit button the page will say loading or actually show a progress bar or percentage counter?
Thanks

Is this a duplicate question? I answered this already under a different post…

Hi Ernie
im in need of your expertise again. You helped me get my jquery which on submit button loads a html file which works great.
Is there a way for each time I choose from the drop down menu and click submit there would be a progress bar of some sort before the chosen html loads? Thanks again.

Here is the jquery section and button which is currently working:

Submit Query

I just posted to another thread on various ways of doing this.

But, first, you are loading a file that is HTML. Does it take a long time to load that file?

One simple way would be to just use a hidden DIV that contains a GIF that is a waiting notice…
When your loadQueryResults starts, make the DIV visible. Then, just before the return false, you
just hide the DIV.

That would be a very simple way to handle it… the hidden DIV would be just a warning about
“Your data is loading…” along with a GIF which would be an animated spinner…

Here is a great site that let’s you create the one you want:
http://ajaxload.info/

I would use one that does NOT have a percentage displayed. Just an animation. Then, view it when
you start your upload and stop it when done… Should work…

Some of the html files can be rather large. How does the invisible div section looks?

Ernie,
I googled and found an ajaxStart () function which supposedly can be used to get the same loading effect. Do you know how I can Incorporate that into my existing jquery or am I totally off regarding ajaxStart?

Well, I read this on the ajaxstart() function:

Definition and Usage
The ajaxStart() method specifies a function to be run when an AJAX request starts.
Note: As of jQuery version 1.8, this method should only be attached to document.

But, it appears it is for a document only. It is not for loading items into a document.
It might work, but, the way I mentioned will.

So, your WAITING DIV would just be a DIV with an image in it.
Just

nothing more…
It would be positioned just above where you are loading the page. Since styling has it turned off,
to show it, just make the style=“visible:block” or use javascript and use .hide and .show as needed.
Should work good.

Try it and if you can’t figure it out let us know. I am not around tonight to help… But, am tomorrow…

Yea I’m pretty lost. Hopefully we can re group tomorrow.
:-X

Ernie,
Where does the

go?

Would it look something like this

Submit Query

Sorry, Bishop, I was gone for the last couple days unexpectedly…

So, a DIV is basically a place holder. It is on a page and can be visible or hidden.
Whatever is inside of the DIV is visible or hidden from sight, too.

Therefore, if you have a GIF that shows a flashing progress bar or a round waiting-arrow
or just about any type of animated warning, it will be visible or hidden under program control.

So, yes, the code you just posted will work. But, inside the “loadQueryResults()” routine, you would
need to change your code to make the hidden warning DIV visible and then just before exiting the
routine, make it hidden again. In this way, the warning GIF will show while loading the page. Once,
loaded, the routine continues with hiding the GIF again and goes on…

Hope that makes sense. Now, to hide or show a DIV, you can use this code:
$( “#mydiv” ).hide( “slow”, function() (.hide or .show) (SLOW or FAST)

More on this is explained here. Look down to the HIDE/SHOW demo and see how it works…
http://api.jquery.com/hide/

Should work nicely for you… Did you create a GIF from that site I posted earlier?

Sponsor our Newsletter | Privacy Policy | Terms of Service