function show(chkw){ 
if(chkw  >= 500){ 
chkw = 550; 
}else{ 
chkw = chkw; 

//alert(chkw); 
return chkw; 
function WBTB_format1(what,opt) 

if (opt=="removeFormat") 

what=opt; 
opt=null; 

WBTB_Composition.focus(); 
if (opt==null) 

WBTB_Composition.document.execCommand(what); 
}else{ 
var image = document.createElement("img"); 
image.src = opt; 
alert(image.src); 
alert("为什么在这里打出点儿东西,才能出图片?????"); 
var str1 = " <img src= '"+image.src+" ' width= '"+show(image.width)+" ' >"; 
var inesertHtml =  WBTB_Composition.document.body.innerHTML; 
WBTB_Composition.document.body.innerHTML = inesertHtml + str1; 

WBTB_pureText = false; 
WBTB_Composition.focus(); 
} 我打印这句话alert("为什么在这里打出点儿东西,才能出图片?????");就能显示图片得到图片大小??? 

解决方案 »

  1.   

    当然不是了。alert只是弹出框呀,跟最终显示什么没任何关系~~
    我不太明白你是什么意思,你最好说清楚出现了什么情况,你不明白什么?
      

  2.   

    alert是弹出框,只是给用户和开发人员查看的信息,对程序功能:如显示就需要接受参数
      

  3.   

    var image = document.createElement("img");  
    image.src = opt;  
    alert(image.src);  
    alert("为什么在这里打出点儿东西,才能出图片?????");  
    var str1 = "  <img src=  '"+image.src+"  ' width=  '"+show(image.width)+"  '  >";  
    var inesertHtml =  WBTB_Composition.document.body.innerHTML;  
    WBTB_Composition.document.body.innerHTML = inesertHtml + str1;  主要在 alert 这里。 我要注销掉 就显示不出来图片。注销掉得到的width就是0;
    不注销反而能够得到图片的大小