Loading a modified div

I create a site for questions and answers.

Currently, two users can log in and access a single page. I tried using the jquery.load function to show both users the same page. The problem is that I have buttons on the page, and I want that when one user clicks the button, the other can see how it changes (these are not “send” buttons, they just change color when pressed).

If I'm right, the .load function only loads the static code into the page. Is there a way to make both sides see the changes that the other makes without refreshing the page? Therefore, if one user changes something in a div, another user must see it.

    jQuery(document).ready( function($){
    $('#Submission-2').load('http://example.com #div');

I am new to jquery (started just a few days ago).

Two users can currently create a batch. a third-party URL has user names like www.example.com/?user1=user1&user2=user2. As soon as both of these users log in and a party is created for them. This is when I need them to open the page. BTW I am using Wordpress.

When the first user sends the data, I add it to the session, and both users can see this information in order. The problem is that the second user must select the information (press the buttons) for this information presented, the first user will not see these changes.

+4
source share
1 answer

, setInterval,

setInterval(function(){
    $('#Submission-2').load('http://example.com')
},3000);

HTTP- 3 , div

  • ,
  • WebSockets
  • Comet

: Long-Polling, Websockets, Server-Sent Events (SSE) Comet?

+1

Source: https://habr.com/ru/post/1650762/


All Articles