Jump to content

Check Out This(tying to do by ajax)


anushka

Recommended Posts

I am mataining the finance company,where i give guides to the the Shares holders,when to sell and when to buy.i cant keep on calling them.I have the records Of all my customer And all are regisetered under different

Website like hotmail,gmail. when i send message it should go to all customers like message not a mail.i am thinking to give a pop up window .Like You got a new Message.suppose if they are not loginin at that time i send the message .then i am thinking to display the message when he login

Is it possible to do

Please tell me how to proceed..I m confident that we can do

Link to comment
Share on other sites

Well you have to use 1 solution, however 2 implementations 1 contains AJAX the other can be done without.

Example adding

 

window.document.setInterval('ajaxFunction()',120000); 

 

will execute the ajax command on a loop every 2 mintues. Now what you would have to do is create a php command that allowed for you check to see if the message has been viewed by the logged in user. Ill leave that part up to you as this is a backend script unique to your programming style.

 

NOWEVER YOU MUST HAVE A JAVASCRIPT FUNCTION AT THE BOTTOM OF THE SCRIPT IF THERE ARE MESSAGES UNREAD. TO SHOW THE DIV. SIMPLY USE A ABSOLUTE DIV PLACED AT THE CENTER OF THE PAGE AND ABOUT 100PX FROM THE TOP.

 

EXAMPLE:

<div id="VirtualMessage" style="position: absolute; top: 100px; left: 50%; margin-left: {ENTER 1/2 OF DIV LENGTH HERE}px; display:none;" ></div>

 

Your ajax command calling the backend file will populate the information within the div of course.

 

-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

 

Since it you have the interval auto running it will automatically start checking on login. What I would do is add a timeout so that you instantly check because the 1st check wont start for 2 minutes. so enter this at the bottom of the first screen they see once logged in.

 

window.document.setTimeout('ajaxFunction()',0); 

 

That should do it.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.