tomjoad2000
09-11-2009, 09:15 AM
I'm converting old js-libraries that does lookups at server to json (finally).
One of the issues I've had is that a new lookup intrerrupts any previous lookup that hasn't been completed. (It's all issued through an hidden iframe).
What's your suggestions regarding multiple requests with different destionations, like filling up different comboboxes etc.
Do I need to build a que-logic, or is there any mature cross-browser technique around?
Currently, JS sends request in hidden iframe, containing parameters and js-function that invoked the request. The server-response contains js-variable, and a call back to the original js-caller-function with "phase2";
fillCombo(lookupName,phase2) {
//if phase1, do request, sql is in session, attach "fillCombo" as caller...
//if phase2, invoked from loaded iframe containing data, fill combo.
}
As you can see, any new request to fill combo, before the prevoius has completed, will break the lookup.
One of the issues I've had is that a new lookup intrerrupts any previous lookup that hasn't been completed. (It's all issued through an hidden iframe).
What's your suggestions regarding multiple requests with different destionations, like filling up different comboboxes etc.
Do I need to build a que-logic, or is there any mature cross-browser technique around?
Currently, JS sends request in hidden iframe, containing parameters and js-function that invoked the request. The server-response contains js-variable, and a call back to the original js-caller-function with "phase2";
fillCombo(lookupName,phase2) {
//if phase1, do request, sql is in session, attach "fillCombo" as caller...
//if phase2, invoked from loaded iframe containing data, fill combo.
}
As you can see, any new request to fill combo, before the prevoius has completed, will break the lookup.