Embed JS file within view

I have a REST API setup. Data is returned as JSON to a view. Included in the JSON is a <script> that is normally used for embedding an iframe widget. The JS generates an iframe containing a thread from another site.


Is there a way to load this directly into the view or another method someone can suggest? I’ve tried binding it using ng-bind and ng-bind-html with no luck.

The js does include a token I could use to generate the iframe within the view (rather than rely on external JS).
<script src="https://.../iframe.js?token=123456"></script> could become <iframe src="https://.../123456></iframe> which would work.

Any suggestions would be appreciated.

Thanks in advance.

@kaustic You did not complete your third sentence. “Included in the JSON is a”…

Updated. Apparently the script knocked out the rest of the sentence.