Getting started with Ajax - how do I query the db without 'submitting' the page?
Hi guys,
I'm building a simple 'power point presentation' - basically a cf page which will display a large jpg [a slide]) every n seconds I want the page to query the db to ask if it needs to change the jpg and if so which jpg should it now show. In this way we can control the presentation by updating the database on the fly.
So I think I will acheive this as follows:
1. a 'display' page that contains javascript that fires every n seconds
2. that js to somehow pass 2 variables (GET?) to an action page (ie user id and an authentication var)
3. the action page will the query the db (using the vars passed in step 2)
4. the action page returns a result (path to jpg to display) which somehow(?!) is passed back to the display page
5. the display page then swaps the jpg it is showing for the one passed back to it in step 4
6. ideally the display page then also passes another 2 variables to the action page letting us know it has received the update and changed the image accordingly
I'm fine with all the html and cfm stuff - where I am stuck is the js bits, I've had a good look through google and don't seem to be making any progress so if anyone could please point me in the right direction I'd be ever so grateful.
Any snippets / advice very gratefully received ![]()
TIA
Nick
