ReferenceError: "window" is not defined
‎Oct 30, 2017
09:36 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
‎Oct 30, 2017
09:36 AM
ReferenceError: "window" is not defined
Hi,
I am not fairly familar with javascript, but found that I could use the following code to get the current URL of the open webpage.
var url = window.location.href;
I am getting an error, "window" is not defined, which I do not understand why.
Is it part of a library not in Thingworx and if so, how can I import that library into Thingworx?
Thank you,
Rami
Labels:
- Labels:
-
Connectivity
-
Extensions
2 REPLIES 2
‎Nov 06, 2017
02:51 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
‎Nov 06, 2017
02:51 PM
Hello. Rami Masoud.
Try running this:
document.getElementById("demo").innerHTML = "Page location is " + window.location.href;
What output do you see? And what browser(s) are you running this in?
Thanks,
-- Craig A.
‎Jul 03, 2018
10:59 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
‎Jul 03, 2018
10:59 PM
after executing this I got this message,
Message :: ReferenceError: "document" is not defined.
Regards,
Abhishek Kumar