flexxall Posted August 3, 2010 Share Posted August 3, 2010 Hello, I have a script running on my homepage and i would like it to be identical for all people at the same time. Meaning the script runs fins when i open the site. then another user opens the site and the script runs fine for them but it is not in sync. how can i sync it so we are both viewing the same instance of the script. I think that makes sense, if not let me know and i can try to explain differently Link to comment https://forums.phpfreaks.com/topic/209623-help-with-javascript-on-homepage/ Share on other sites More sharing options...
haku Posted August 3, 2010 Share Posted August 3, 2010 Give specifics. But basically, the script will never run exactly the same - the script is run in the browser, and people will be accessing the script in their browser at different times. However, it is possible to somewhat synchronize output through background calls to a server. But it will never be perfect, as there will be lag times between the users browser and the server, and that lag time will be different for different users. Plus, some computers will execute the javascript faster than others. Link to comment https://forums.phpfreaks.com/topic/209623-help-with-javascript-on-homepage/#findComment-1094405 Share on other sites More sharing options...
flexxall Posted August 3, 2010 Author Share Posted August 3, 2010 the script on the main page is rotating images using jquery.cycle I would like for all the people that open the site regardless of when it is open to see the same images in the current rotation that they are in for other users. I understand about the lag issues and browser speed that makes sense. If i cant run the script server side and need to do it client side you mentioned i could make server calls. how would i go about doing that ? Link to comment https://forums.phpfreaks.com/topic/209623-help-with-javascript-on-homepage/#findComment-1094417 Share on other sites More sharing options...
xenophobia Posted August 3, 2010 Share Posted August 3, 2010 Maybe you are looking at this? www.jsrs.org Link to comment https://forums.phpfreaks.com/topic/209623-help-with-javascript-on-homepage/#findComment-1094421 Share on other sites More sharing options...
haku Posted August 3, 2010 Share Posted August 3, 2010 You can set it up so that users can see the same set of cycling images - just make the server give those images to the user. But why would you want to make them all look at the same image at the same time? It will be quite a performance hit to do this. Link to comment https://forums.phpfreaks.com/topic/209623-help-with-javascript-on-homepage/#findComment-1094426 Share on other sites More sharing options...
flexxall Posted August 3, 2010 Author Share Posted August 3, 2010 the reason for viewing the same images for all uses is ... if one of the users clicks on one of the images it dissapears and is assigned to them now the other users can not click that image as it is not available any more. If they are not viewing the same rotational screen then multiple users would have access to the same image file which i need to avoide Link to comment https://forums.phpfreaks.com/topic/209623-help-with-javascript-on-homepage/#findComment-1094447 Share on other sites More sharing options...
haku Posted August 3, 2010 Share Posted August 3, 2010 Ajax. And you'll need to load your images from the server. Link to comment https://forums.phpfreaks.com/topic/209623-help-with-javascript-on-homepage/#findComment-1094485 Share on other sites More sharing options...
flexxall Posted August 3, 2010 Author Share Posted August 3, 2010 thanx I"ll look into that possibility Link to comment https://forums.phpfreaks.com/topic/209623-help-with-javascript-on-homepage/#findComment-1094815 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.