»
EnglishFrenchVietnamese

Print - AJAX Page Content Loader - JavaScriptBank.com

Full version: jsB@nk » Ajax » AJAX Page Content Loader
URL: http://www.javascriptbank.com/ajax-page-content-loader.html

AJAX Page Content Loader © JavaScriptBank.comAJAX - a very great web development technology nowaday. Use this AJAX in order to load XML and HTML files on the same website with XMLHttpRequest. And in the body section, just call the name of the file need to get page content and the element for the content page display in, usually a DIV element.

Full version: jsB@nk » Ajax » AJAX Page Content Loader
URL: http://www.javascriptbank.com/ajax-page-content-loader.html



CSS
<style type="text/css"><!--#contentLYR {  position:relative;/*  width:200px;  height:115px;  left: 200px;  top: 200px;*/  z-index:1;}--></style>


JavaScript
<script type="text/javascript"><!-- Begin/*     This script downloaded from www.JavaScriptBank.com     Come to view and download over 2000+ free javascript at www.JavaScriptBank.com*/// Created by: Eddie Traversa (2005) :: http://dhtmlnirvana.com/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 = '<JavaScriptBank>This is content of demo.xml file</JavaScriptBank>';//x.responseText;      }    }    x.open("GET", url, true);    x.send(null);  }}//--></script>


HTML
<div id="contentLYR"></div><script>window.onload = function(){ajaxLoader('demo.xml','contentLYR');}</script>


Files
/javascript/ajax/AJAX_Page_Content_Loader/demo.xml