Jump to content

Help with Javascript on homepage


flexxall

Recommended Posts

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
Share on other sites

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
Share on other sites

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
Share on other sites

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
Share on other sites

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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.