Board Thread:General Coding Help/@comment-9605025-20180609225939/@comment-9605025-20180629100911

Hey guys. I have another question but I am adding to this thread because I don't think it deserves its own.

What is considered the best practice for setting a "flag" to know if a script has already started running? For example, let's say I have this script on my wiki but I also load it in my personal global JS. Right now, I end up getting two copies of the content when on my wiki because both versions run. I had initially thought checking for the id of the inserted content would work but not so. I forgot to account for the fact that the API query is an asynchronous request.