forked from titanoid/appjs-framework
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
63 lines (53 loc) · 1.68 KB
/
index.html
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
<title>AppJsFramework</title>
</head>
<script>
var isdev = true;
var app;
function breakCache(text) {
var seconds = new Date().getTime() / 1000;
text = text.replace(/.js"/g, '.js?v='+seconds+'"');
text = text.replace(/.css"/g, '.css?v='+seconds+'"');
return text;
}
function loadApp() {
var loader = document.createElement('IMG');
loader.src = 'img/loader.gif';
loader.width = 128;
loader.height = 128;
loader.style.position = 'absolute';
loader.style.left = '50%';
loader.style.top = '50%';
loader.style.marginLeft = '-64px';
loader.style.marginTop = '-64px';
document.body.appendChild(loader);
var url = 'http://dev.lolaholic.com/app/www/activity_index.html';
var xmlhttp = new XMLHttpRequest();
// Callback function when XMLHttpRequest is ready
xmlhttp.onreadystatechange=function() {
if(xmlhttp.readyState === 4) {
if (xmlhttp.status === 200) {
document.body.removeChild(loader);
if (isdev)
var content = breakCache(xmlhttp.responseText);
else
var content = xmlhttp.responseText;
document.write(content);
}
else {
// document.body.innerHTML = "Error loading page " + url;
document.write("Error loading page " + url);
}
}
};
xmlhttp.open("GET", url , true);
xmlhttp.send();
}
</script>
<body onload="loadApp()">
</body>
</html>