function get_source() 2. { 3. var ele_names = document.getElementsByTagName("textbox"); 4. alert(ele_names[0].getAttribute("path")+" "+ele_names[0].id); var foo=function(textBox,src_path) { xmlHttp = new XMLHttpRequest(); 17. 18. xmlHttp.onreadystatechange = function() 19. { 20. if(xmlHttp.readyState == 4) 21. { 22. textBox.setAttribute("value",xmlHttp.responseText); 23. } 24. } var qstr = '/xul/Startrev?getfile='+src_path; 28. xmlHttp.open('GET',qstr,true); 29. xmlHttp.send(null); 30. } 25. 5. var i=0; 6. for(i=0; i < ele_names.length; i++) 7. { 8. try{ 9. var src_path = ele_names[i].getAttribute("path"); 10. alert("src_path = "+src_path); 11. alert(ele_names[i].id); 12. }catch(myError) 13. { 14. alert("In Catch"); 15. } foo(ele_names[i],ele_names[i].getAttribute("path")); 16. } 34. }