Showing results for 
Show  only  | Search instead for 
Did you mean: 
Community Member

How do I clear an Account level Javascript using a Subaccount JS?

Probably a fairly easy question. My situation is this. We have an old evaluation software which is being retired. It uses a custom JS in the theme editor. We are piloting our new evaluation software in a subaccount. We have themes turned on and I applied the new system's JS in the subaccount. 

However, the JS in the main account conflicts with the subaccount's JS. Is there a command or something I can put in the subaccount JS to clear any script being executed? 

The only script in the account level JS is the one I want to stop, so a global command is ok. 

0 Kudos
4 Replies
Community Coach
Community Coach

Hello Curtis,

There's nothing at the Canvas level that you can put in a sub-account theme to "clear" JS from the main account theme.

It's possible that something like storage clear() method in JS would do it (see Storage clear() Method ), but I'm definitely no JS expert, so you'd want to play with it to see if it gets you the results you're looking for.

Mind if I ask which evaluation software you're retiring?  (We are using eXplorance Blue, and there's a bunch of JS added to the theme for that one...)


Tried this in test to no avail. Thanks for the reply though!

0 Kudos

Hello Curtis,

Unfortunately I don't think you've provided enough information for your question to be properly answered.  What is the old script, what is the new script, how are they invoked?  What is the nature of the error/conflict?  Are they using a shared namespace?  etc.

Without some of the above information the answers may be so varied as to be useless, but some of the following may generally be requred:

* Unset the objects created by the first script (may have to use a timer to wait for them to first be instantiated)

* move the new script to a new namespace

* step through the script(s) and look for race conditions

* write a set of methods to resolve the conflict between the first script and the second before the second executes.

0 Kudos
Community Coach
Community Coach

Good evening,  @rogers_c ...

I am reviewing some of the older questions here in the Canvas Community, and I happened to come across your question.  While I don't have an answer for you, I wanted to check in with you.  I see that both  @mzimmerman  and  @tdw  provided you with some feedback.  In addition, Danny had some more questions for you that needing answering in order to better help you out.  Have you had a chance to review Danny's response?  If you could please come back to this topic to provide those answers, that would be helpful.  Or, if you've been able to find a solution on your own, we would like to know that as well (detailing what your solution was).  For the time being, I am going to mark your question as "Assumed Answered" mainly because there hasn't been any new activity in this topic since April 9, 2019 (more than seven months).  However, that won't prevent you or others from posting additional questions and/or comments below that are related to this topic.  I hope that's okay with you, Curtis.  Looking forward to hearing back from you soon.

0 Kudos