xiangjiejie
on the load

导航

 

json内容

;<img src="/newsfile/1506271512489.jpg" width="600" height="450" alt="" /></p><p style="text-align: center;">

用ng-bind-html绑定json数据,浏览器将会输出
<img width="600" alt="">
ng自动过滤了src属性,再次琢磨发现src是全路径的时候,浏览器就能输出我想要的src了
猜测angularjs是处于安全考虑,那就手动加全路径吧
html=htmldecode(dt.cContent)//第一步还是反编译
sr='src="/';
sh="height"
$scope.list.cContent=htmldecode(dt.cContent).replace(new RegExp(sh,'g'),'k').replace(new RegExp(sr,'g'),'src="http://www.xjj.com/')//第二步

 

就酱紫,有空再排版


posted on 2015-07-16 15:02  xiangjiejie  阅读(1201)  评论(0编辑  收藏  举报