详细问题描述
[iOS 7.1.2 版本下 验证码显示不出来的问题]
重现步骤
[给img的src赋值验证码的链接]
[页面没有显示验证码]
[能够显示出]
运行环境
[iOS 7.1.2]
[APP]
[HBuilder 8.1.3.201705121932]
[mui版本]
附件
[java中是jFinal框架
public void captcha() {
CaptchaRender img = new CaptchaRender();
render(img);
}
html中代码
<img id="verifycodeimg" class="fright" src="" />
<script>
$(function(){
//初始化验证码
$("#verifycodeimg").attr("src",ipAddr+"/app/member/captcha?random="+ Math.random());
//刷新验证码图片
$('#verifycodeimg').on('click',function(){
refreshVrifyCode(this);
});
});
mui.plusReady(function(){
self = plus.webview.currentWebview();
//plus.webview.getSettings().setSavePassword(false);
});
//刷新验证码
document.addEventListener("refreshVrifyCode", function(){
var verifyImg = $("#verifycodeimg")[0];
$(verifyImg).attr('src',ipAddr+'/app/member/captcha?random='+ Math.random());
});
//刷新验证码
function refreshVrifyCode(obj){
console.log("refreshVrifyCode");
//console.log(obj.tagName);
//console.log($(obj).attr('src'));
$(obj).attr('src',ipAddr+'/app/member/captcha?random='+ Math.random());
}
</script>
]]
[安装包]
联系方式
[QQ]
[电话]
1 个回复
喵了个咪
mui("#verifycodeimg")[0].setAttribute("src", "http://xxx.xxx.xxx/xxx.jpg");