Skip to main content
17-Peridot
August 2, 2021
Solved

js code

  • August 2, 2021
  • 1 reply
  • 990 views

Why window.location.hostname, window.location.host codes and showing errors inside Thing services??  

Best answer by PaiChung

In your Things (Server side JScript) window and location do not exist.

if you are doing this in an Expression widget, client side, Window is not allowed.

1 reply

PaiChung22-Sapphire IAnswer
22-Sapphire I
August 3, 2021

In your Things (Server side JScript) window and location do not exist.

if you are doing this in an Expression widget, client side, Window is not allowed.

17-Peridot
August 4, 2021

What you mean when you telling 'client side'?

22-Sapphire I
August 4, 2021

You need the code to run in a Mashup/web page on the user's machine (How you normally expect JS to be used)