【发布时间】:2014-07-25 02:38:28
【问题描述】:
所以我遇到了一个有趣的问题,但我还没有找到答案。
假设我从 JSON 文件中获得了一堆数据,但不知何故其中一个主要字段看起来像这样
description : '<img src="http://o.aolcdn.com/hss/storage/midas/37c38989a5f26031be3e0ec5ffc5cd2/200012386/got-hbo-go-crash-2014-04-07-01_thumbnail.jpg"/> Viewing of the Game of Thrones season debut came to a crashing halt yesterday thanks to server problems with HBO Go. The cable outfit first reported the problem late yesterday via Twitter, and finally restored full service early this morning. That...'
如何在使用 ng-bind-html 将 json 数据绑定到页面上的 innerHTML 时从该 IMG 获取 src。 (使用 display:none; 在 img 本身上,所以它不会显示)
我尝试过 getElementsByTags 等,但没有返回有效值。
是否有某种“角度”的方式来做到这一点或......?
BR
【问题讨论】:
标签: javascript html json angularjs