Using jQuery and Ajax to Change an Element's Style for All Users

Encuentantra

New Member
I'd like to have a button that changes the display property of a certain element for all users of a site, not just the person who clicked the button. The button is used to show that a user is online by changing an element's display from "none" to "inline" and should be visible to all. So far I have an html file with the button that changes the display property with jQuery:\[code\]<div id="john" style="display:none">John</div><script>var goOnline = function (user) { $('#' + user).css('display', 'inline');}</script><button type="button" onclick="goOnline(john);"/>Go Online</button>\[/code\]I've looked around and using jQuery's Ajax functionality seems to be a good solution but I'm not sure how to implement it properly. I'd really appreciate any help. Thanks.
 
Back
Top