Hi @jaja ,
You could try to use SP.ClientContext("https://yoursiteurl")
instead of SP.ClientContext.get_current()
to setup the clientContext. It may work for you.
clientContext=SP.ClientContext("https://yoursiteurl")
If an Answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.