问题描述
- firefox中 onclick="pic()"怎么不能执行?
-
function pic()
{if (!validateMode()) return;
message.focus();var range =message.document.selection.createRange();
var arr = showModalDialog("pic.asp", "", "dialogWidth:26.5em; dialogHeight:13em; status:0;help:0");
if (arr != null){
var ss;
ss=arr.split("*")
a=ss[0];
b=ss[1];
c=ss[2];
d=ss[3];
e=ss[4];
f=ss[5];
var str1;
str1=""
str1=str1+"
str1=str1+" border=0 align='"+e+"'>"+d+"
"
form1.PicUrl.value=a;
form1.PicList.options[form1.PicList.length] = new Option(a,a);
range.pasteHTML(str1);
}
else message.focus();
}<img class=None onmousedown="Check(this,2)" onmouseover="Check(this,1)" onmouseout="Check(this,0)" onmouseup="Check(this,1)" src="images/image.gif" align="absmiddle" border="0" style="cursor:hand;" alt="插入网上图片,支持格式为:gif、jpg、png、bmp" lANGUAGE="javascript" onclick="pic()">
点击图片无法弹出插入图片对话框!?
解决方案
onclick="pic();"
解决方案二:
调用代码没有问题,在浏览器的开发者模式下F12,调试下你这个pic()方法,例如进入方法时console.log("call pic.");是不是方法return返回了呢?
时间: 2024-08-25 09:08:55