954,566 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

iframe refresh using AJAX?

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><font face='Verdana' style='font-size:14pt' color='lightblue'>uploaded</font>";

?>


Thank you.

akshayinbox
Light Poster
32 posts since Aug 2009
Reputation Points: 8
Solved Threads: 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.

akshayinbox
Light Poster
32 posts since Aug 2009
Reputation Points: 8
Solved Threads: 0
 

I really need it. Any source/link is welcome too!

Thank you!

akshayinbox
Light Poster
32 posts since Aug 2009
Reputation Points: 8
Solved Threads: 0
 

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

Someone please help me with it.

Thank you

Akshay

akshayinbox
Light Poster
32 posts since Aug 2009
Reputation Points: 8
Solved Threads: 0
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: