473,320 Members | 2,111 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

AJAX Refresh?

22
Hi,

I basically have two frames on my page, the top one contains users stats and the bottom frame contains the website.

I want to have a message icon on the top frame which would flash once the user gets a new message. Obviously I would have one message icon which doesn't flash and another which does.

Right now i refresh the top frame every 30 seconds so that the stats update. But is there an easier way to refresh? I mean right now the whole top frame refreshes which can get annoying.

I was told to use AJAX to refresh the values, instead of the whole frame.

I currently use this html code to refresh the whole frame:
Expand|Select|Wrap|Line Numbers
  1. <META http-equiv="refresh" content="10">

The part i want to refresh is:
[PHP]
<?php
if ($inbox > 0){ echo "<a href=inbox.php target=middle><img border=0 src=images/unread1.gif align=left width=16 height=11></a> ";
}else{ echo "<img src=images/read.gif align=left width=16 height=11>"; }

if ($inbox > 0){ echo "<span style=FONT-WEIGHT:bold><a href=inbox.php



ONMOUSEOUT=\"javascript:document.location.reload() ;\"

target=middle><font color=#990066>$inbox New </a></font></span>"; } ?>[/PHP]



Please let me know how to apply an AJAX code to it so that the message status is updated.

Thanks
Dec 2 '07 #1
5 3159
gits
5,390 Expert Mod 4TB
hi ...

welcome to TSDN ...

that is a very basic question ... you should have a look at some ajax-tutorials ... or for a quickstart look at this article. in your top-frame you should make an ajax-request that calls the input.php with setInterval(); ... so that would be the idea, now try something and come back in case you have specific questions about it ...

kind regards
Dec 2 '07 #2
Kaante
22
hi ...

welcome to TSDN ...

that is a very basic question ... you should have a look at some ajax-tutorials ... or for a quickstart look at this article. in your top-frame you should make an ajax-request that calls the input.php with setInterval(); ... so that would be the idea, now try something and come back in case you have specific questions about it ...

kind regards
i don't know anything about AJAX, i work with php,css,html,mysql

thats why i asked if anyone could help me do it. I read the articles and i didnt understand anything.
Dec 2 '07 #3
gits
5,390 Expert Mod 4TB
hi ...

ok ... in case you don't have any clue ... read this first ... it gets you ontrack ... the article i told you before shows the code you would need for your task ... it is not that much ... but i makes no sense to rewrite an ajax-tutorial here.

quick-walkthrough:

basically you need a instance of a XMLHttpRequest-Object. now you set some properties of that object and call some methods ... send it with a querystring to your server ... the instance waits for the response and handles it, when the response is send back to the client ... the handling is a function you write for yourself ... so you may update a div if you want :) ... read the above article carefully its not very complicated ...

kind regards
Dec 2 '07 #4
Kaante
22
hi ...

ok ... in case you don't have any clue ... read this first ... it gets you ontrack ... the article i told you before shows the code you would need for your task ... it is not that much ... but i makes no sense to rewrite an ajax-tutorial here.

quick-walkthrough:

basically you need a instance of a XMLHttpRequest-Object. now you set some properties of that object and call some methods ... send it with a querystring to your server ... the instance waits for the response and handles it, when the response is send back to the client ... the handling is a function you write for yourself ... so you may update a div if you want :) ... read the above article carefully its not very complicated ...

kind regards
i appreciate your help, however i think i won't be able to do this myself. So i am willing to pay someone a small amount ($20) via paypal to code this small refresh feature.

If you or anyone could help me with this then please contact me.

Thanks
Dec 3 '07 #5
Kaante
22
Hi,

I basically have two frames on my page, the top one contains users stats and the bottom frame contains the website.

I want to have a message icon on the top frame which would flash once the user gets a new message. Obviously I would have one message icon which doesn't flash and another which does.

Right now i refresh the top frame every 30 seconds so that the stats update. But is there an easier way to refresh? I mean right now the whole top frame refreshes which can get annoying.

I was told to use AJAX to refresh the values, instead of the whole frame.

I currently use this html code to refresh the whole frame:

[HTML]<META http-equiv="refresh" content="10">
[/HTML]

The part i want to refresh is:

[PHP]<?php

if ($inbox > 0){ echo "<a href=inbox.php target=middle><img border=0 src=images/unread1.gif align=left width=16 height=11></a> ";

}else{ echo "<img src=images/read.gif align=left width=16 height=11>"; }



if ($inbox > 0){ echo "<span style=FONT-WEIGHT:bold><a href=inbox.php

ONMOUSEOUT=\"javascript:document.location.reload() ;\"

target=middle><font color=#990066>$inbox New </a></font></span>"; } ?>[/PHP]





Please let me know.

Thanks
Dec 3 '07 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

11
by: John Smith | last post by:
I am using Ajax to refresh a DIV area by setting the innerHTML=request.responseText in the usual manner. in the response text I have a <SCRIPT> tag in line, but this is not executed. Is there a way...
3
by: Beshoo | last post by:
hey gaiz plz I want to cerate log in system in ajax i do it but i have one problem AFTER I start thes session then press refresh key the session gone !!! in other words , after the user type hid...
0
by: Phillip Ian | last post by:
Tried this over in CSharp.General and didn't get anything, so I thought I'd try again here. If there's an AJAX specific group I could ask this in, please let me know...I did look. I'm trying to...
10
by: Piotr Nowak | last post by:
Hi, Say i have a server process which listens for some changes in database. When a change occurs i want to refresh my page in browser by notyfinig it. I do not want to refresh my page i.e....
25
by: Piotr Nowak | last post by:
Hi, Say i have a server process which listens for some changes in database. When a change occurs i want to refresh my page in browser by notyfinig it. I do not want to refresh my page i.e....
10
by: paulie | last post by:
Hi, I have been experiencing an issue when trying to use AJAX to reload a DIV area using a timer of 2000ms, which contains a html page with another DIV and javascript. Scenario -------------...
1
by: Nightcrawler | last post by:
I have a parent updatepanel with a repeater in it that generates 10 child updatepanels. I have one button that will refresh all these 10 updatepanels. On the button click I go through the...
1
by: luigi.corrias | last post by:
Hello everybody, this is a very difficult question… imagine 2 webform asp.net A and B B is an iframe inside A..
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.