/    Sign up×
Community /Pin to ProfileBookmark

I have a problem that I don’t know the solution to.

I have a section on a website that needs to be changed. But the change is not cuased by onClick, or onMouseOver. The change is when an xml fle is updated. What is the best way to go about this. Do I need a server side script to initiate this and if so how does the server communicate to the browser?

Alternativly I was thinking of setting up a very short timer. Like every 15 or 30 seconds. How does gmail do this?

to post a comment
JavaScript

3 Comments(s)

Copy linkTweet thisAlerts:
@ToonMarinerAug 29.2006 — I take it a section of your site is driven by the xml file....

Well any change in that file will only show once the page is refreshed or the client sends a request via ajax to update that particular section.

If simply updating the xml file will change the section of your page automatically on refresh then I suspect your timer option would be best.
Copy linkTweet thisAlerts:
@toicontienAug 29.2006 — You'd need some sort of periodical updater running on your page, probably by the setInterval() function. The server cannot innitiate communication with the Web browser directly. That sort of communication is possible with Java applets or Flash objects.

In your case, having a function fire at an interval is your best way to go.
Copy linkTweet thisAlerts:
@kofman2155authorAug 29.2006 — Thank you for your prompt replies, their trying to create the illusion of live updating. I'll give it a try and hopefully the process wont be too taxing.
×

Success!

Help @kofman2155 spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.3,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,
)...