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 Quote Link to comment 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. Quote Link to comment 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 ? Quote Link to comment 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 Quote Link to comment 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. Quote Link to comment 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 Quote Link to comment 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. Quote Link to comment 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 Quote Link to comment 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.