Retrieve Evothings Connection URL automatically

Ask, and ye shall receive.
jthurst3
Posts: 1
Joined: 17:09, 30 Jun 2014

Retrieve Evothings Connection URL automatically

Postby jthurst3 » 17:17, 30 Jun 2014

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.

ardiri
Posts: 58
Joined: 16:13, 28 May 2014

Re: Retrieve Evothings Connection URL automatically

Postby ardiri » 15:37, 07 Jul 2014

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
// Aaron
Chief Technology Officer
Evothings AB http://www.evothings.com/


Return to “Questions and answers”

Who is online

Users browsing this forum: No registered users and 5 guests