first commit
This commit is contained in:
13
code/1-status/index.html
Normal file
13
code/1-status/index.html
Normal file
@@ -0,0 +1,13 @@
|
||||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title> WebDiver testpage</title>
|
||||
<meta name="description" content="">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
</head>
|
||||
<body>
|
||||
<h1>This is a WebDiver testpage</h1>
|
||||
<script src="webdriver.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
19
code/1-status/webdriver.js
Normal file
19
code/1-status/webdriver.js
Normal file
@@ -0,0 +1,19 @@
|
||||
// Query the status method
|
||||
request = new XMLHttpRequest();
|
||||
request.open('GET', 'http://localhost:7020/status', true);
|
||||
|
||||
request.onload = function() {
|
||||
// Put the received data into the dom
|
||||
var el = document.createElement('div');
|
||||
var contents = document.createTextNode(request.responseText);
|
||||
el.appendChild(contents);
|
||||
document.getElementsByTagName('body')[0].appendChild(el);
|
||||
};
|
||||
|
||||
request.onerror = function() {
|
||||
// There was a connection error of some sort
|
||||
console.error('err:', arguments);
|
||||
};
|
||||
|
||||
// Fire the request
|
||||
request.send();
|
||||
Reference in New Issue
Block a user