0

Hello.

I don't know how to use AJAX.

Can someone please help me?

I'm using an iframe to display percentage of file uploaded. The iframe refreshes itself every 2.5 seconds. It's okay for now, but not a practical solution.

I need iframe to refresh but, it shouldn't look like its refreshing (using AJAX).

You can see a live example: http://mintload.com/upload/upload-single.php

(Choose a sample file, click "Upload")

Code for iframe fileprog.php (php+js):

<?php

//Code for calculating percentage excluded from this post,not required.

//Here's where JS comes into use:
echo sprintf('<script>setTimeout( function(){location.href="%s?sid=%s&cb=%s"} ,2500);</script>',$_SERVER['PHP_SELF'], $sessionid, time());

 echo "<font face='Verdana' color='#00CED1' style='font-size:24pt; font-weight:bold;'>".$percent_done."% </font><br><font face='Verdana' style='font-size:14pt' color='lightblue'>uploaded</font>";

?>

Thank you.

1
Contributor
3
Replies
4
Views
7 Years
Discussion Span
Last Post by akshayinbox
0

To see iframe in detail. In Mozilla Firefox, while upload progress is being displayed, right click->This Frame->Open frame in new tab
(And u'll only see iframe + its URL in address bar)

Thank you.

0

Ok, since I urgently need it. I'm requesting one last time..

Someone please help me with it.

Thank you

Akshay

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.