1

I am new to angular and we have a single page app built using angular. We want to have threaded discussions for every content we have. For this we are planning to integrate with Jive. Jive provides a way to embed discussions from jive on another site.

They just ask to include a js file and that automatically inserts a "Discussion" link in line on your site. Jive does it with the help of document.write.

If I include the js file in on our main app page it works. If i include the js file in one of partials it wont work and I get

Failed to execute 'write' on 'Document': It isn't possible to write into a document from an asynchronously-loaded external script unless it is explicitly opened.

I dont have access to change the js that is coming back from Jive.

How can i get around this?

Thanks, Sam

1 Answer 1

1

you need to create a directive that creates script element. Look at this answer How to write an AngularJS directive that creates DOM elements that are other directives?

I hope that helps...

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.