Jump to content

Nested AJAX


cyberstu
 Share

Recommended Posts

Hi all. Im currently doing a database development project. Im not yet at the development stage, however I have had a few ideas. Im planning on using AJAX in my web frontend so I dont have to constantly load up pages. I have a basc AJAX system that I have tested and was just wondering if it is poosible to nest AJAX within AJAX.Basically im going to have a page with a menu on it. WHen you click an item on the menu, it will bring up a query result, or a data entry form linked to my database. These pages will be within an AJAX elemnt so the menu never gets reloaded only the query or form. However when I am loading uo my database records I am going to have navigation buttons and update/insert/new buttons as well. Is it possible to have a seconday AJAX loop, so that when I click next only the actual results get refreshed.I hope this makes sense. Basically:----------------------------------------------------------------------------- HEADER----------------------------------------------------------------------------- MENU------------------------------------------------------------------------------ FORM LOADED FROM MENU VIA AJAX | | | ------------------------------------------- | | SECONDARY AJAX SECTION | | | SCROLLS DATABASE WHEN NAV | | | BUTTON CLICKED | | | AND DISPLAYS INSERT/ | | | DELETION FAILED OR WORKED| | | | | | | | -----------------------------------------| | | NAV BUTTONS GO HERE UPDATING THE ABOVE AJAX | SECTION | | |-------------------------------------------------------------------------------I know the above diagram looks messy but it looks different when Im typing this in the new topic window.

Edited by cyberstu
Link to comment
Share on other sites

are you asking if it's possible to make an AJAX call from the content contained within the response of an AJAX call?

Edited by thescientist
Link to comment
Share on other sites

AJAX element? Secondary AJAX loop? This is not any conventional terminology I'm aware of.If it helps: there is no limit to the number of times a document can make an AJAX request. If you use unique request objects, one request can be made while an earlier one is still in progress. JavaScript functions do not care HOW they are called. Any event will do. An element added to the DOM after the document is originally loaded can certainly have an event listener that binds it to a function.Any of that help?

Link to comment
Share on other sites

AJAX element? Secondary AJAX loop? This is not any conventional terminology I'm aware of.
Yeah sorry about my incorrect use of terminology. Ive basically just done a crash course covering HTML, JS and PHP in two days, so im not yet fully upto speed with the proper terminology. Im still learning. I have done programming before with C++, which I understand better, im still getting my head around these scripting languages. Actually find it wierd not having to define variable types and not having to do function prototypes.And by the way Deirdre's Dad, thanks for your input, you have cleared up my question so I should be able to do my project the way that I want to. Just bogged down with the design work at the minute. Will probably post some updates when I actual;ly get around to the coding part.Thank everyone for your help.
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...