May i know how to write javascript to ping to server and show how many users online on browser? This concept same like facebook online friends. I heard my senior said that if using javascript, it will cause heavy load since it will take a lot of resources while using actionscript wont have such issue since the server can respond to the browser. I really dont have any idea how to write the javascript to check. Hopefully somebody here can give a helping hand. Thanks. <a href="http://codebasic.net">CodeBasic</a>
You'd probably want to use ajax to grab a value off the server and show in on the page. jQuery makes this fairly easy. You'd need a php script or something running on the server. The ajax can call this script directly, which returns the number of users currently online. Or the script could run every 5 minutes (or whatever) and create a static file, which the ajax then grabs and uses. Depending on how much traffic your site gets, that may be a better option.