Skip to content
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
31 lines (29 sloc) 864 Bytes
<title>Sample Page to Demo Yeoman</title>
<h1 id="mainHeader"></h1>
<script type="text/javascript">
//So over here we are trying to create an IIFE to avoid one line of extra code.
(function loadDataFromExpressApp(){
var xhttp;
* Old browers like IE5 and IE6 does not support XMLHttpRequest. :)
xhttp = new XMLHttpRequest();
xhttp = new ActiveXObject('Microsoft.XMLHTTP');
xhttp.onreadystatechange = function(){
if(this.readyState === 4 && this.status === 200){
document.getElementById('mainHeader').innerHTML = xhttp.responseText;
};'GET', '/data', true);
You can’t perform that action at this time.