MxGucci Posted November 13, 2008 Share Posted November 13, 2008 I am at work right now, don't have access to my code but I have a small 5 star rating script, which is php/mysql based, when I run the script on my page, and if the user clicks on a star and rates the script, it refreshes the whole page, although fast its pretty annoying, is there any way to run scripts within an iframe or something? Sorry if my question doesnt make sense or if you all need the code before hand to answer. I will upload the code once I get home. Thanks, Gucci Link to comment https://forums.phpfreaks.com/topic/132633-refreshing-php-script-within-a-frame/ Share on other sites More sharing options...
rhodesa Posted November 13, 2008 Share Posted November 13, 2008 You want to use AJAX. It allows you to send data in the background. Writing your own cross-browser transport script is kind of messy, so I recommend using one of the many JS libraries out there to help you. I would check out jQuery and it's AJAX functions. Link to comment https://forums.phpfreaks.com/topic/132633-refreshing-php-script-within-a-frame/#findComment-689754 Share on other sites More sharing options...
Gighalen Posted November 13, 2008 Share Posted November 13, 2008 Or just add header( 'refresh: 5; url=#' ); within an iFrame. It'll refresh the iFrame every 5 seconds. While it wont be user-activated, it still might serve some purpose. Link to comment https://forums.phpfreaks.com/topic/132633-refreshing-php-script-within-a-frame/#findComment-689786 Share on other sites More sharing options...
rhodesa Posted November 13, 2008 Share Posted November 13, 2008 why would you want to refresh the iframe every 5 seconds if you just plan on posting a rating? it's a one time data transfer on an onclick event. Link to comment https://forums.phpfreaks.com/topic/132633-refreshing-php-script-within-a-frame/#findComment-689798 Share on other sites More sharing options...
MxGucci Posted November 14, 2008 Author Share Posted November 14, 2008 You want to use AJAX. It allows you to send data in the background. Writing your own cross-browser transport script is kind of messy, so I recommend using one of the many JS libraries out there to help you. I would check out jQuery and it's AJAX functions. Thank you sir, I'll test it out and I'll get back to you guys if I face any problems. Link to comment https://forums.phpfreaks.com/topic/132633-refreshing-php-script-within-a-frame/#findComment-689841 Share on other sites More sharing options...
rhodesa Posted November 14, 2008 Share Posted November 14, 2008 A quick google search found this site. Which lists several ways of doing the rating widget: http://www.progressive-coding.com/tutorial.php?id=6 Link to comment https://forums.phpfreaks.com/topic/132633-refreshing-php-script-within-a-frame/#findComment-689848 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.