Re: Refer to dynamically generated objects during page load
- From: intrader <intrader@xxxxxxx>
- Date: Sun, 09 Sep 2007 11:43:24 -0700
Thomas 'PointedEars' Lahn wrote:
Sisilla wrote:All very interesting responses. What sizilla may wish is along the linesOn Sep 8, 11:52 am, Thomas 'PointedEars' Lahn <PointedE...@xxxxxx>
wrote:
Sisilla wrote:I am usingxmlHttp.responseXML yields an (I)XML(DOM)Document object reference, given a
[element].innerHTML=xmlHttp.responseText
to generate some multiple selection dropdowns. Before the page is
finished loading, I would like to manipulate the dropdowns by calling
some javascript functions. The trouble is that I cannot refer to the
dropdownobjects until after the page has loaded.
Is there any way to accomplish what I'm trying to do without
constructing the dropdowns with DOM document methods?
response served with an XML media type. You can manipulate that document
with DOM methods (you have to, or it would have to be PITA-string-parsing),
and assign the serialization of the document tree to `innerHTML'. That
said, I don't think you need `innerHTML' anymore then.
And if you think about it, if the responseText value is the result of a
database query as you state in [1], the server should generate the
appropriate response in the first place, without you having to script
anything client-side.
[...]
Please trim your quotes, and don't quote signatures unless you are referring
to them. TIA.
FYI: Some multiple option select elements are getting their options
from the database, and based on another query, certain options will be
pre-selected. Is this scenario really that impossible to imagine?
No, it is conceivable. I am doing that myself.
Your reply has left me with an idea, however. I will try to execute
both queries before updating innerHTML, and try to assign "selected"
attributes to the appropriate options based on the second query. I'll
let you know how it turns out. Thanks.
Good luck.
However, I am still not convinced that using `innerHTML' (which is a
proprietary property, BTW) is even necessary here. If you change the
content of the document when it is just loaded anyway, why could the
server not generate the proper markup (with all options properly
selected) in the first place?
PointedEars
1. listbox A, dynamically generated
2. listbox B where the contents of this listbox is chosen according to a selection in listbox A.
So theoretically if listbox A has 4 selections, you may have four different lists in lisbox B.
This is a common occurrence in RIA applications. It is perhaps possible to do this via innerHTML replacement, however, the way I have done it is via direct manipulation of the option arrays in the listboxes.
As PointedEars suggests you may no need innerHTML replacement
.
- Follow-Ups:
- Re: Refer to dynamically generated objects during page load
- From: Thomas 'PointedEars' Lahn
- Re: Refer to dynamically generated objects during page load
- References:
- Refer to dynamically generated objects during page load
- From: Sisilla
- Re: Refer to dynamically generated objects during page load
- From: Thomas 'PointedEars' Lahn
- Re: Refer to dynamically generated objects during page load
- From: Sisilla
- Re: Refer to dynamically generated objects during page load
- From: Thomas 'PointedEars' Lahn
- Refer to dynamically generated objects during page load
- Prev by Date: Re: variables not set
- Next by Date: Re: Refer to dynamically generated objects during page load
- Previous by thread: Re: Refer to dynamically generated objects during page load
- Next by thread: Re: Refer to dynamically generated objects during page load
- Index(es):
Relevant Pages
|