Re: Refer to dynamically generated objects during page load
- From: Thomas 'PointedEars' Lahn <PointedEars@xxxxxx>
- Date: Sun, 09 Sep 2007 03:14:41 +0200
Sisilla wrote:
On 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
.
- Follow-Ups:
- Re: Refer to dynamically generated objects during page load
- From: Sisilla
- Re: Refer to dynamically generated objects during page load
- From: intrader
- 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
- Refer to dynamically generated objects during page load
- Prev by Date: Re: Trying to create a ticker in javascript
- Next by Date: Re: Trying to create a ticker in javascript
- 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
|