成人在线亚洲_国产日韩视频一区二区三区_久久久国产精品_99国内精品久久久久久久

您的位置:首頁技術(shù)文章
文章詳情頁

javascript - 使用angular給圖片動(dòng)態(tài)賦值src屬性出現(xiàn)unsafe的情況

瀏覽:151日期:2024-03-07 11:52:49

問題描述

百度過后,在appmodule中設(shè)置了app.config的值 $compileProvider.imgSrcSanitizationWhitelist(/^s*(https?|local|data):/);但是沒有效果

想問一下大家還有什么其他辦法能去掉這個(gè)unsafe

html代碼: <p class='user_pic'><img src='http://m.piao2010.com/wenda/{{item.UserID | imgSrc}}' height='178px;'></p>controller中:app.filter(’imgSrc’, function () {

return function (input) {var src = ’’;if (input == undefined) { return;}$.ajax({ url: BaseURL + '/MainUser/LoadUserPersonalHomepageByUseriD?userID=' + input, type: ’get’, async: false, success: function (data) {if (data.UploadIMG == null) { src = ’/img/tp.png’} else { src = data.UploadIMG} }})return src; }});

問題解答

回答1:

https://stackoverflow.com/que...

標(biāo)簽: JavaScript
相關(guān)文章: