在项目中需要做一个效果就是window.open(url,name,config)打开一个窗体,但是浏览器的titlebar中不能显示其地址的url以及about:blank.
代码如下:
var win = window.open("","win","height=100px,width=100");
win.document.body.innerHTML="<iframe width='100%' height='100%' style='border:none' src='http://www.baidu.com'></iframe>";
win.document.head+="<style type='text/css'>html,body{height:100%;width:100%margin:0 auto;}</style>"
相同的方法,若是我window.open打开一个窗口,往内部写入一个img标签,并且读取一个远端地址的图片。ff下的titlebar只显示最基本的Mozilla Firefox的标签,而不显示about:blank和url地址。