getting started...

getting started...

Postby cdav » Tue Feb 21, 2017 6:26 am

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>
United States of Americacdav
Newcomer
 
Posts: 6
Joined: Thu Feb 16, 2017 12:48 pm

Re: getting started...

Postby bill6502 » Wed Feb 22, 2017 12:00 am

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.
User avatar
United States of Americabill6502
Developer
 
Posts: 703
Joined: Fri Feb 07, 2014 5:28 pm


Return to Services API



Who is online

Users browsing this forum: No registered users and 1 guest