How to get View name?
Aug 16, 2019
10:14 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Aug 16, 2019
10:14 AM
How to get View name?
Hello friends
how is possible to obtain actual View name in JS?
thank you for every post.
Tomas
Solved! Go to Solution.
Labels:
- Labels:
-
Best Practices
-
Coding
ACCEPTED SOLUTION
Accepted Solutions
Aug 20, 2019
01:45 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Aug 20, 2019
01:45 PM
You should be able to use the window.location.hash property to find this, along these lines:
var viewname = window.location.hash.substring(2);
2 REPLIES 2
Aug 20, 2019
01:45 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Aug 20, 2019
01:45 PM
You should be able to use the window.location.hash property to find this, along these lines:
var viewname = window.location.hash.substring(2);
Aug 21, 2019
02:44 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Aug 21, 2019
02:44 AM
Hello ClayHelberg
Thank you much again. This syntax is exactly what I need.
It works really fine for both - 2D and 3D Views.
I tried to put window and window.location to console.log() and I was really suprised how much information I can obtain. This is really inspirative for me.
Regards
Tomas
PS: for the final recap:
/**
* Function return name of active View.
*
* @return (String) - view name.
*/
$scope.getViewName = function() {
var name = window.location.hash.substring(2);
console.log(name);
return name;
}
