getting started...

Post Reply
cdav
Newcomer
Posts: 6
Joined: Thu Feb 16, 2017 12:48 pm
United States of America

getting started...

Post 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>
User avatar
bill6502
Developer
Posts: 2307
Joined: Fri Feb 07, 2014 5:28 pm
United States of America

Re: getting started...

Post 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.
Post Reply