Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Klint Youngmeyer
PicoTestSite
Commits
e14c19f8
Commit
e14c19f8
authored
Dec 09, 2019
by
Klint Youngmeyer
Browse files
Add function to get switch state
parent
ecee01c6
Changes
1
Hide whitespace changes
Inline
Side-by-side
www/page2.html
View file @
e14c19f8
...
...
@@ -64,6 +64,18 @@ Send questions to <a href="mailto:supporrt@emacinc.com">support@emacinc.com</a>.
action
:
'
toggle
'
}));
};
function
getSwitch
()
{
var
xhr
=
new
XMLHttpRequest
();
xhr
.
open
(
"
GET
"
,
"
/get_switch
"
,
true
);
xhr
.
onreadystatechange
=
function
()
{
if
(
this
.
readyState
==
XMLHttpRequest
.
DONE
&&
this
.
status
==
200
)
{
var
data
=
xhr
.
responseText
;
var
jsonResponse
=
JSON
.
parse
(
data
);
document
.
getElementById
(
"
switchMsg
"
).
innerHTML
=
jsonResponse
[
'
status
'
];
}
}
xhr
.
send
();
};
</script>
</body>
</html>
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment