dgrafx
asked on
Push a notification to other website visitors triggered by an event
I'm looking for the simplest way to do the following:
Users are on a website doing their thing then when one of them submits a form via Ajax and when the Ajax call is complete then "push" a "notification" to all other visitors that are currently on the site.
Thanks
ASKER
OH NO!! I should have stated that I can't use websockets because of a limitation on my shared host ...
What other ideas do you have?
I appreciate it!
BTW - is it possible to use socket.io without installing anything on my host?
What other ideas do you have?
I appreciate it!
BTW - is it possible to use socket.io without installing anything on my host?
Hi,
Which serverside code are you using, PHP, ASP ?
ASKER
There isn't a server language on the front end - just Javascript. There is database connectivity on the backend using CF that is communicated with via Ajax.
Thanks
Thanks
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
OK,
If you're using ColdFusion, then you'd need a different server-side wrapper. Here's a link to a ColdFusion one, but I know nothing about it.
The client-side JS would stay the same
If you're using ColdFusion, then you'd need a different server-side wrapper. Here's a link to a ColdFusion one, but I know nothing about it.
The client-side JS would stay the same
ASKER
Thanks Chris! I will experiment later today!
Can you post that CF link that you mentioned please.
Can you post that CF link that you mentioned please.
ASKER
Thanks Chris! I'll post after testing ...
What I think you're looking for is WebSockets. Basically, you would need to configure a server and a client. A good example is the Pusher service (https://pusher.com/). There's also Socket.IO (https://socket.io)
You would create a Channel on the Server, and then configure your website to listen to that Channel
When a User makes an AJAX request, you would 'push' your message to the server, and the 'listener' would see that and receive a notification. You then code your site to handle that notification (update the HTML / alert a message etc).
That's a very, very basic overview of the process. Exactly how you implement this will depending on your own development stack. For example, if you're using Laravel, look into Broadcasting.