Page 1 of 1

Retrieve Evothings Connection URL automatically

Posted: 17:17, 30 Jun 2014
by jthurst3
Hi,

I notice that the Evothings connection URL is displayed at the bottom left hand corner of the Evothings Workbench. Is there a way to retrieve this URL automatically in one of my apps? For example, suppose I want to modify the Hello World app to read: "Hello World! The Evothings Connection URL is [connection URL]", where [connection URL] is the URL displayed in the bottom left hand corner of the Workbench. Right now my best solution is to manually copy the URL into index.html, but I have to do this every time the URL changes. Does anyone have a better solution?

Thanks.

Re: Retrieve Evothings Connection URL automatically

Posted: 15:37, 07 Jul 2014
by ardiri

Code: Select all

<p>
Connection URL is [<script>document.write(window.location)</script>]
</p>


just include that within your HTML code.
if you want to get just the hostname and port, change variable window.location.hostname and windows.location.port.

// Aaron