【问题标题】:Getting 404 error in browser console when using iframes使用 iframe 时在浏览器控制台中出现 404 错误
【发布时间】: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.passw‌​ord +"&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


【解决方案1】:

404 错误意味着在您的应用需要的特定 URL 中找不到某些资源。检查错误描述以找出它是什么文件。 (您可能有错字,或网址错误)

【讨论】:

猜你喜欢
  • 2021-11-09
  • 1970-01-01
  • 2018-04-24
  • 1970-01-01
  • 1970-01-01
  • 2012-12-02
  • 2016-10-23
  • 2021-08-26
  • 1970-01-01
相关资源
最近更新 更多