RSS Forums RSS
Please support our JavaScript / DHTML / AJAX advertiser: Lunarpages Web Hosting

Dynamic Div Name getElementById

Join Date: Apr 2008
Posts: 8
Reputation: vinothkumarc is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
vinothkumarc vinothkumarc is offline Offline
Newbie Poster

Re: Dynamic Div Name getElementById

  #2  
Apr 25th, 2008
I hope.. ur using static div's for response text... right!!!


Make some relations for those ids...

like..
div_content_details_1,
div_content_details_2
div_content_details_3.. and etc.,

if u might know that ur using three divs
then declare one global javascript variable

assign value like

/**/
  1. var xmlHttp;
  2. var id_to_disp;
  3. function showDetails(str, control) // here itself u deside which div u want to use
  4. {
  5. if(control.name="control1") {
  6. id_to_disp = 'div_content_details_1';
  7. }
  8. .......
  9.  
  10.  
  11. document.getElementById(id_to_disp).innerHTML=xmlHttp.responseText
  12. ..
/**/

Sorry if anything wrong... bcoz i might not know wt ur thinking

Thanks,
VinothKumar.C
<snipped>
Last edited by peter_budo : Apr 26th, 2008 at 3:33 pm. Reason: 1)Please use [code] tags. 2) Please do not use "leet" speak or "chatroom" speak. 3) No emails or phone numbers in posts!
Thanks & Regards,
VinothKumar C
91+9841797606
post2vinoth@gmail.com
Reply With Quote  
Forums | Blogs | Tutorials | Code Snippets | Whitepapers | RSS Feeds | Advertising
All times are GMT -4. The time now is 11:14 am.
Newsletter Archive - Sitemap - Privacy Statement - Acceptable Use Policy - Contact Us
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC