AJAX is the answer - how to get started?
Posted: Tue Jan 22, 2008 11:50 am
Hi everyone
I'm currently building an intranet database application to manage our company invoicing/contact information
I'm gradually migrating it from our current FileMaker system over to PHP/MySQL, and there's many improvements that this will allow me to make!
Part of the new system is a way for users to create timed events and notes... eg: to call/email a particular person on a certain day/time
In the old FileMaker system, you would specify a date and then on that date the user would be sent an e-mail to their mailbox informing them of the task/schedule item.
In addition to that, I'd also like to be able to pop up a small window in their browser informing them of the task/schedule event at a particular time
Obviously for that to work they'll need to be browsing the intranet application for the popups to trigger. The user will be able to choose whether they want email alerts or popup window for each schedule item they create.
Rather than triggering these popups when they load a new page (not ideal if a user leaves their browser idle, as they won't be informed of the event until they refresh the page).
I'd like to have an AJAX script that runs every 5 minutes to check if there are any overdue notifications and pops up a window automatically if there are any.
So the AJAX script calls a PHP script which delivers some XML output of the overdue tasks, if there are any.
Writing the PHP script and delivering the XML output is easy... so long as I know how to format the XML output that's required by the AJAX script.
But I don't know how to perform the AJAX call, interpret the results and deal with any errors.
I've written bits and bobs with JavaScript before, but I've never touched AJAX stuff so I don't really know where to start.
I'm assuming the best thing would be some sort of library that can handle all the complex stuff - any recommendations?
I've heard of JQuery, Scriptaculous/Prototype... and I assume there'll be a way to do something like this with those.
But I'm looking for more AJAX starters/beginners advice really.
All the users are using recent browsers... FireFox, IE 6/7, Safari OS X Panther... which should all support this kind of stuff
And there's only going to be 20 users max once the solution is up and running, so it's very small-scale in terms of load.
Any ideas/suggestions on the best way to do this?
Thanks
Ben
I'm currently building an intranet database application to manage our company invoicing/contact information
I'm gradually migrating it from our current FileMaker system over to PHP/MySQL, and there's many improvements that this will allow me to make!
Part of the new system is a way for users to create timed events and notes... eg: to call/email a particular person on a certain day/time
In the old FileMaker system, you would specify a date and then on that date the user would be sent an e-mail to their mailbox informing them of the task/schedule item.
In addition to that, I'd also like to be able to pop up a small window in their browser informing them of the task/schedule event at a particular time
Obviously for that to work they'll need to be browsing the intranet application for the popups to trigger. The user will be able to choose whether they want email alerts or popup window for each schedule item they create.
Rather than triggering these popups when they load a new page (not ideal if a user leaves their browser idle, as they won't be informed of the event until they refresh the page).
I'd like to have an AJAX script that runs every 5 minutes to check if there are any overdue notifications and pops up a window automatically if there are any.
So the AJAX script calls a PHP script which delivers some XML output of the overdue tasks, if there are any.
Writing the PHP script and delivering the XML output is easy... so long as I know how to format the XML output that's required by the AJAX script.
But I don't know how to perform the AJAX call, interpret the results and deal with any errors.
I've written bits and bobs with JavaScript before, but I've never touched AJAX stuff so I don't really know where to start.
I'm assuming the best thing would be some sort of library that can handle all the complex stuff - any recommendations?
I've heard of JQuery, Scriptaculous/Prototype... and I assume there'll be a way to do something like this with those.
But I'm looking for more AJAX starters/beginners advice really.
All the users are using recent browsers... FireFox, IE 6/7, Safari OS X Panther... which should all support this kind of stuff
And there's only going to be 20 users max once the solution is up and running, so it's very small-scale in terms of load.
Any ideas/suggestions on the best way to do this?
Thanks
Ben