Sending popup message in the middle of session - javascript

I wonder is there a way to send users an alert message in the middle of a session? for example when a transaction status changes from "process" to "succeed" I want the user to know it in the middle of their session.
I hope my question can be answered using jQuery AJAX. Many thanks.

You should look into using Comet for things like this. I assume you meant that you want to alert the user without them having performed some action? The atmosphere project has a javascript component that can be used client side to achieve this, but it will also require some support from your back-end.

Related

Session manipulated client side

I'm trying to program a check off calendar/task app.
Want I want to achieve is that, whenever I click on a box it should be checked off, show it's crossed off ( Day is crossed off ).
And then I want to store this is in my session.
What I'm thinking about doing is setting a boolean variable in the HTML to true and then send it with the session. So it can be remembered when I reload the page. But I still see the problem of letting the server-side know that this boolean has changed. Is this the way to achieve this? Is there some better way?
Controlling my server-side is Nodejs and I'm using the ejs templating. I'm using express-session to manage my session.
Thanks in advance!

Secure Redirect URLS + Survey Monkey

I am using survey monkey to allow users to ask users several questions. If they answer the form, they get upgraded to "premium" and are redirected back to the site. There is no code that survey monkey returns that allows me to know that the user actually submitted the form and is not accessing the redirect URL directly. How can I get around this security wise? I want to make sure the user actually submitted the form to qualify for premium. I'm using node.js on the server side and javascript on the client side.
It's not the prettiest solution, but a quick way I noticed that could be possible from the help center is to disqualify respondents. This is because you can set a custom URL to send the user to after you disqualify them which I don't know if you can otherwise.
You can use advanced branching logic to specify when to disqualify the respondent (example, when the last question is answered). You can also use webhooks through the API to get notifications on respondent completions and you can make changes on your end (such as upgrading their plan) using that.
That's one suggestion, you may want to investigate the help center if that doesn't work for you.

How can I send "push notifications" to a specific users webpage?

I'm not really sure where to begin.
I'd like to be able to update a users current page when another user either updates my database or sends a specific GET/POST request (I could write it either way).
I was thinking server sent events but I made a quick test using my php server and realized a couple things. First I would need an event loop based server because using php I'd have to create a loop to keep checking my database for a specific change. Second I realized this would be very server intensive so I should look into another method.
So to explicitly ask my questions...
Is it possible to update a users current page when someone else sends a GET request to a php file on my server? How?
If I need an event loop based server what is my best option? node.js?
Is this possible with sockets if not with SSE? SSE makes more sense because I'm not looking for any user feedback.
Thanks
Websockets and something like SignalR for ASP.Net could help you. Check out the options here
You can use Ajax too.
Like this : Here

Realtime update the Message board on website

I want to have a function that when the user write a comment on message board. User can see the message board update right away without refresh the website, like facebook!
I am new to JS and Ajax, and I found some ways to realize it as bellow. Is there any simple method or API to realize it?
I am totally new. Any advise will be helpful.
I use PHP before btw.
1.Ajax
2.ezcomet
3.Pusher
4.Comet
5.ASP.NET SignalR
You would use ajax or websockets(for games or real time apps). I don't know what 2 and 3 are. I think comet is a library. Message boards usually refresh the page because they are slow. I think your talking about a social network.

Check if user Likes Page with JS API?

I know this has been asked a bunch of times, but I have only seen serverside solutions.
I'm running an iframe app that is embedded into a page as a tab. I want be test to see if the page is liked or not without prompting the user for anything.
Is there a way to do this with just JavaScript? The platoform we are building on is ASPX and I dont really have the option of going serverside.
Its not available because you need to inspect the http post parameter called signed_request and this isn't available on the client side. If the user has authenticated with your app and given you permissions to read their likes/interests, then you could then check with javascript api but I'm guessing you wouldn't want to make them approve your app just for this.

Categories

Resources