LemonInflux Posted October 8, 2007 Share Posted October 8, 2007 For a start, I know absolute 0 about AJAX. I know just about enough JavaScript to scrape by. Soon, I will rectify this; but right now, I need a starting point. So, here it is. If I understand correctly, AJAX should be able to do this. My query is this: Say, I have a code, that writes to a file. Above this code, is a window that displays everything in the file. How do I get the window to be updating all the time, so, say, the person who writes to that file can a) see his own replies, and b) see everyone else's. Quote Link to comment https://forums.phpfreaks.com/topic/72348-live-update-using-ajax/ Share on other sites More sharing options...
RichardRotterdam Posted October 8, 2007 Share Posted October 8, 2007 just to explain what ajax does i'll give a simple description. ajax means you use javascript to call an external serverside(php page prob in your case) to be executed. this happens withoutout leaving the current page your one(refreshing). It is possible to update parts of your DOM html for instance a layer. What you are looking for is probably a script that refreshes a part of your HTML periodically. The data has to be fetched using php Quote Link to comment https://forums.phpfreaks.com/topic/72348-live-update-using-ajax/#findComment-364921 Share on other sites More sharing options...
bobleny Posted October 9, 2007 Share Posted October 9, 2007 Try this as a guide, www.w3schools.com/ajax It is a really good starters guide! I've found that the best way to do script AJAX, at least for me anyways, is to script the PHP aspect of it first. Once you have the server doing what you want it to do with the inputed data, It is a simple matter of using JavaScript to send the data rather than refreshing the page. My advice to you is to start simple though. First, make a PHP script echo a word. Then use a simple button to call the word on command. Then use that exact same script and make a box so that you can input data to be displayed on command. I would also strip back all of the HTML and make it as simple as you can. Good luck! Quote Link to comment https://forums.phpfreaks.com/topic/72348-live-update-using-ajax/#findComment-365191 Share on other sites More sharing options...
LemonInflux Posted October 9, 2007 Author Share Posted October 9, 2007 @Dj: I was pretty sure of that, yes. Any help? @Bobleny: I'll read that another time. I have a job now, that needs AJAX, and I haven't got the time to read all through that. Coursework + job = not much time for reading. Quote Link to comment https://forums.phpfreaks.com/topic/72348-live-update-using-ajax/#findComment-365483 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.