【发布时间】:2016-07-22 05:31:04
【问题描述】:
我在 angularjs 中使用 iframe。我已经声明了一个包含 iframe url 的变量。功能工作正常,但浏览器控制台显示 404 错误,即找不到该变量。
下面是sn-p的JS代码:
scope.classifierSrc = null;
scope.classifierSrc = $sce.trustAsResourceUrl( CONSTANTS.STATUS_URL+response.result.username+"&password="+response.result.password +"&sam_id="+response.result.sample_id+"&r_id="+response.result.run_id +"&p_id="+response.result.project_id+"&l_id="+response.result.library_id); });
还有HTML代码:
<div class="modal-body">
<iframe width="100%" height="450" ng-src="{{classifierSrc}}" class="varentiframe"> </iframe>
</div>
【问题讨论】:
-
提供JS代码和HTML代码。没有这个,没有人会帮助你。
-
欢迎使用stackoverflow!请在提问前阅读此内容:-stackoverflow.com/help/how-to-ask
-
分享 iframe 代码方便调试
-
你会分享你运行的代码吗
-
尝试使用 ng-src 并分享您如何在 HTML 中使用 classifierSrc 变量的代码
标签: javascript angularjs