Quantcast
Channel: Active questions tagged meta - Meta Stack Overflow
Viewing all articles
Browse latest Browse all 172

Is it possible for a Stack Snippet to get information about the post it's running in?

$
0
0

Stack Snippets have many uses, and while I don't use them that often on Stack Overflow (I haven't been active for while, let alone in the tag), they also have their uses on other sites in the network. Specifically, I'm trying to make it easier to keep track of the bugs and feature requests on new feature announcements. For that, it would be nice if the snippet is aware of the answer or at least the Q&A page it's embedded in.

But when I run the simple code below, it returns

https://stacksnippets.net/js

which I'm sure is correct but not helping me at all.

console.log(location.href);

Hence my question: is it possible at all for a Stack Snippet to get information about the post it's running in? I'm aiming for a reusable script which doesn't require hardcoding post IDs.


Viewing all articles
Browse latest Browse all 172

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>