我有以下问题,我在我的jsp中有一个iframe,它指向相同的上下文上下文域,当我从任何计算机打开它时没有问题,但是当想要在Android设备上从chrome打开它时,它仍然是空白的(在iframe内部只有一个文本框和一个按钮),它也发生在三星自己的浏览器中,然后尝试不同的方式,但我无法使它工作。
在这里,我试着看看它是否是Android设备和Chrome浏览器。
var userAgent = navigator.userAgent || navigator.vendor || window.opera;
if (/android/i.test(userAgent)) {
var is_chrome = window.chrome;
if(is_chrome){
console.log("Device android");
resizeLoginPrincipal();
}else{
obj.style.height = document.body.scrollHeight + 'px';
}
}else{
obj.style.height = document.body.scrollHeight + 'px';
}
这是原作。
function resize() {
$('iframe:not(.not_resize)').each(function(index, iframe){
iframe.style.height = 0;
iframe.style.height = iframe.contentWindow.document.body.scrollHeight + 'px';
});
}
这里有我的iframe。
<iframe id="ifrmLgn" width="100%" marginheight="0" marginwidth="0" onLoad="resize()" scrolling="no" frameborder="0" src="<%=path%>" align="bottom" iframe.src="javascript:parent.getFrameHTML()"></iframe>
我希望已经解释过,我已经和他一起待了好几天了,而且我已经不知所措了。
谢谢。