Page 1 of 1

getting started...

Posted: Tue Feb 21, 2017 6:26 am
by cdav
Hi, I am trying to familiarize myself with using the Myth Service API. If I paste "http://192.168.0.2:6544/Myth/GetHostName" into the address bar on the browser, I get the expected result. However when I load the script below into my browser, nothing happens. Am I on the right track?

<!DOCTYPE html>
<html>
<body>
<h1>The XMLHttpRequest Object</h1>
<p id="demo">Let AJAX change this text.</p>
<button type="button" onclick="loadDoc()">Change Content</button>
<script>
function loadDoc() {
var xhttp = new XMLHttpRequest();
xhttp.open("GET", "http://192.168.0.2:6544/Myth/GetHostName", false);
xhttp.send();
document.getElementById("demo").innerHTML = xhttp.responseText;
}
</script>
</body>
</html>

Re: getting started...

Posted: Wed Feb 22, 2017 12:00 am
by bill6502
Hi,

The app I'm familiar with opens a connection to port 6544 directly,
as opposed to going to 80 1st. Things like XSS and CORS come
to mind, but I'm not a web guy.