Re: how to retrieve a dom from innerHTML......

From: Date: Wed, 20 Jan 2010 09:23:38 +0000
Subject: Re: how to retrieve a dom from innerHTML......
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-301247@lists.php.net to get a copy of this message
I am on the top of the world! Borlange University wrote:
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'<https://mail.google.com/mail/html/compose/static_files/'getInfo_gx.php'> , method:'get', onSuccess:function(response) {
   if(option==1) $('list_sch').innerHTML = response;         //response =
"<select id='sch_list><.......'"; 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 = "<select id='sch_list'><option value='123'>123312</option></select>";
 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')); }); } });
You probably ought to ask a Javascript forum about javascript problems...

« previous php.general (#301247) next »