how to retrieve a dom from innerHTML......
am 20.01.2010 05:36:10 von michael3832628--0016e64cce942b99ae047d91206d
Content-Type: text/plain; charset=ISO-8859-1
hello, i can obnot retrieve a select ject from div innerHTML.
what i want to do is that when a page is loaded, first selector,say #1,
would be shown in the first div by sending a request.then i choose one
option from #1, fire change event of #1, the second selector #2 will be
shown in div two, then choose option from #2 .............blabla..
but the problem is when selector #1 was loaded, the object #1 could not be
obtained.
codes:
window.addEvent('domready', function() {
var option=1;
var result = new Request({
url:'getInfo_gx.php'
,
method:'get',
onSuccess:function(response)
{
if(option==1) $('list_sch').innerHTML = response; //response =
"
else if(option==2) $('list_gg').innerHTML = response;
else $('list_gx').innerHTML = response;
}
});
result.send('type=1'); // page loaded,sending a request.
$('list_sch').innerHTML = "";
if($('sch_list')) // heres the problem... object can not
be obtained.
{
$('sch_list').addEvent('change',function(){ // events
can not be fired
option=2;
result.send('type=2'+'&sch='+$('sch_list').value.replace('+' ,'%2B'));
});
}
});
--0016e64cce942b99ae047d91206d--