Link to home
Start Free TrialLog in
Avatar of denny3d
denny3d

asked on

loading when page make an operation

Hi EE
i have a question:
Can I add a loader (like gif animator , like ajax) when i lanch an operation into may page?
Example :
I have a php page that send some request and print video the result, some times, the result return after 50/60 seconds, so i would add a loader when my page attend.
I dont know how i implement this.
Can you help me?
I use in my project php - mysql and use jQuesry framework.

Regards
Denis
Avatar of Jagar Mohammad
Jagar Mohammad
Flag of Canada image

Please check the following page: http://www.dynamicdrive.com/dynamicindex4/preloadimage.htm

Let me know if it didin't help.
I do this when uploading files... but same principle for any form submit which will take some time to process...
<script type="text/javascript">
 
 
        $(document).ready(function(){
                var validator = $("#importForm").validate({ 
                        // specifying a submitHandler prevents the default submit, good for the demo 
                submitHandler: function() { 
                        $('#importit').hide();
                        $('#importing').show(); // show animation
                        $("#importForm").submit();
                } 
                });
        });
 
</script>               
<form action="index.php" method="post" enctype="multipart/form-data" name="importForm" id="importForm">
<div id="importit">
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="1">
        <tr valign="top">
                <td class="label"><label id="lufile" for="ufile">Import File</label></td>
                <td class="field">
                        <input name="ufile" type="file" id="ufile" size="50"  class="required" value="" accept="csv"/><br>
                        <b>NOTE:</b> Maximum filesize is <b>approximately $php_upload_max_filesize</b>.<br>
                </td>
                <td> </td>
        </tr>
        <tr>
                <td class="label"><label id="limportsubmit" for="importsubmit"></label></td>
                <td class="field" colspan="2">
                        <input id="importsubmit" name="importsubmit" type="submit" value="Import Hubs">
                </td>
        </tr>
</table>
<div style="clear: both;"> </div>
</div>
</div>
</form>

Open in new window

Avatar of denny3d
denny3d

ASKER

no , it's not ok
i lanch a link and not open an image
Avatar of denny3d

ASKER

@BrianMM

where div #importing ?
:)
<script type="text/javascript">
 
 
        $(document).ready(function(){
                var validator = $("#importForm").validate({ 
                        // specifying a submitHandler prevents the default submit, good for the demo 
                submitHandler: function() { 
                        $('#importit').hide();
                        $('#importing').show(); // show animation
                        $("#importForm").submit();
                } 
                });
        });
 
</script>               
<form action="index.php" method="post" enctype="multipart/form-data" name="importForm" id="importForm">
<div id="importit">
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="1">
        <tr valign="top">
                <td class="label"><label id="lufile" for="ufile">Import File</label></td>
                <td class="field">
                        <input name="ufile" type="file" id="ufile" size="50"  class="required" value="" accept="csv"/><br>
                        <b>NOTE:</b> Maximum filesize is <b>approximately $php_upload_max_filesize</b>.<br>
                </td>
                <td> </td>
        </tr>
        <tr>
                <td class="label"><label id="limportsubmit" for="importsubmit"></label></td>
                <td class="field" colspan="2">
                        <input id="importsubmit" name="importsubmit" type="submit" value="Import Hubs">
                </td>
        </tr>
</table>
<div style="clear: both;"> </div>
</div>
</div>
</form>
<div style="display: none;" id="importing">
<b>Please be patient, importing into ACSLite...</b>
<br><br><img src="./media/images/ajax-loader.gif" alt="Loading...">
</div>

Open in new window

Avatar of denny3d

ASKER

hello EE
i have an example
cam you see this link and try to serch anythink
you can saw a loading in the middle of the page, when the page load.
can i make this effects?

this is the link

www.bancodinapoli.it

regards
ASKER CERTIFIED SOLUTION
Avatar of denny3d
denny3d

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial