A piece of ajax-type javascript which polls the server every 20 seconds. If the server sends back a message, that message is to pop-up in a notification box.
I’ll do the server side which will just send back a message in JSON format to your script if there is a new alert for the user. For example, the following message might be sent back from the server:
{‘message’: ‘New trading signal: Buy Eur/Usd at 1.2345, Stop loss: 1.2314, Target 1: 1.2390’}
If there is no message to display, then the result that comes back from the server will just be: {}
Once you pop-up a notification box, it will remain displayed until the user clicks the ‘x’ to close it . If another message comes through from the server while the previous pop-up is still open, I’d like the new message to just replace the old message in the same pop-up.
That part i want to do how can i do it?