sughan_90 Posted November 21, 2012 Share Posted November 21, 2012 Hi, Im new to ajax. i have to use partial page rendering(PPR) techique to complete my project. Project Description: im doing a livescore system. what i plan is the client site should get the latest score once it has been uploaded by admin in database. This score update should not refresh the complete page. This is something like facebook upadate peoples comment on a post while we seeing it. the notification numbers in facebook automatically increase whn people comment or like for us even we didnt reload the page. Need help: i need help to create this system. how to auto trigger the PPR in client site to get latest score in Database once it has been inserted. can anyone help me doing this? is there any related tutorial videos to refer? Thanks in advance Quote Link to comment https://forums.phpfreaks.com/topic/270968-looking-for-help-in-partial-page-rendering/ Share on other sites More sharing options...
txmedic03 Posted November 23, 2012 Share Posted November 23, 2012 Basically, there are libraries out there like jQuery which make it easy to do what it is you are wanting. How it will work: Let's say you have a <div></div> container for the portion of the page that displays your score stuff that needs to be updated. In that <div></div> you need the contents of showscores.php which has the score information. Your ajax script will pull that information and replace whatever is in that <div></div> with the new content. You'll set a repeating timer to do this on a set interval. This means that every x number of seconds, your ajax script will get the contents of showscores.php and put it into the <div></div>. If there was a change, your users will see the change. Going the ajax route will require that your users have javascript capable browsers and that javascript is enabled. There is another option called reverse ajax, but it requires special software to implement. Depending on your server configuration, this may not be a viable option. If you ask more precise questions you'll get more precise answers. Quote Link to comment https://forums.phpfreaks.com/topic/270968-looking-for-help-in-partial-page-rendering/#findComment-1394671 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.