블로그 이미지
Sunny's

calendar

1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31

Notice

'file script load'에 해당되는 글 1

  1. 2009.09.30 Ajax load XML file script
2009. 9. 30. 18:20 Ajax

Header Script
<script type="text/javascript">
/******************************************
* Ajax load XML file script -- By Eddie Traversa (http://dhtmlnirvana.com/)
* Script featured on Dynamic Drive (http://www.dynamicdrive.com/)
* Keep this notice intact for use
******************************************/
  
   function ajaxLoader(url,id)
 {
  if (document.getElementById) {
   var x = (window.ActiveXObject) ? new ActiveXObject("Microsoft.XMLHTTP") : new XMLHttpRequest();
   }
   if (x)
    {
   x.onreadystatechange = function()
     {
    if (x.readyState == 4 && x.status == 200)
      {
      el = document.getElementById(id);
      el.innerHTML = x.responseText;
     }
     }
    x.open("GET", url, true);
    x.send(null);
    }
     }

</script>


Body
<body onload="ajaxLoader('basic.xml','contentLYR')">
<div id="contentLYR">
</div>
</body>

posted by Sunny's
prev 1 next