我自己弄了个别人在线编译文本,因为本来的没有图片上传功能,所以我把1.6.3的上传图片的FTB.IMAGEGALLERY.ASPX弄了过来,可是弄过来了,图片可以上传,可是点际图片的时候没有反应,正常的话应该可以自己插到编辑区域的啊;
调用FTB.IMAGEGALLERY.ASPX页的代码:url = showModalDialog("comm/uploadimage.htm","window","dialogWidth:640pt;dialogHeight:500pt;status:0");
这里的URL要是为这样的形式的话http://www.hao123.com/masjf.gif
或别的什么AFA.GIF的时候都是正常的.
我的问题就是怎么showModalDialog("comm/ftb.imagegallery.aspx","window","dialogWidth:640pt;dialogHeight:500pt;status:0");没有返回值????
调用FTB.IMAGEGALLERY.ASPX页的代码:url = showModalDialog("comm/uploadimage.htm","window","dialogWidth:640pt;dialogHeight:500pt;status:0");
这里的URL要是为这样的形式的话http://www.hao123.com/masjf.gif
或别的什么AFA.GIF的时候都是正常的.
我的问题就是怎么showModalDialog("comm/ftb.imagegallery.aspx","window","dialogWidth:640pt;dialogHeight:500pt;status:0");没有返回值????
window.returnValue來設置返回值
怎么调用?不是直接window.returnValue=xxx;
然后xxx的值就传给了主窗口的showModalDialog()了吗?
function ReturnValue()
{
var parwin = window.dialogArguments;
parwin.document.all.txtPersonName.value=document.all.txtValue.value;
parwin.document.all.txtPersonNo.value=document.all.txtUser.value;
window.close();
}
</script>
codeangel(-- 与人方便,自已方便 --)
还不不明白,returnvalue()不用自己定义的吧.我看资料不是showmodaldialog("你的地址","你要传的值","子窗口属性")
然后在子窗口中用 window.returnValues=xxx;返回值xxx给showmodaldialog("你的地址","你要传的值","子窗口属性")?
要是在沉的话,在顶,开马甲也要顶到解决为止
myImageHolder.Attributes["ondblclick"]="returnImage('" + ImageFileLocation.Replace("\\","/") + "','" + myImage.Width.ToString() + "','" + myImage.Height.ToString() + "');"; 他的作用是双击事件发生的时候,触发 returnImage(imagename,width,height) 事件来返回值的,返回的时候返回的数组(保存图片名/宽/高)如下:<SCRIPT LANGUAGE="JavaScript">
<!--
function returnImage(imagename,width,height) {
var arr = new Array();
arr["filename"] = imagename;
arr["width"] = width;
arr["height"] = height;
window.parent.returnValue = arr;
window.parent.close();
}
//-->
</SCRIPT>返回到页面后取得返回的数组,插入图片OK
<SCRIPT LANGUAGE="JavaScript">
<!--
function InsertPic()
{
if (!validateMode())
{
return;
}
HtmlEdit.focus();
var range = HtmlEdit.document.selection.createRange();
var arr = showModalDialog("InsertPic.aspx?<%=Request.QueryString%>", window,"dialogWidth:300px; dialogHeight:200px;help:0;status:0;resizeable:1");
if (arr != null)
{
var imagestring = "<img src='uploads/"+ arr['filename'] + "' width='"+arr['width']+"' height='"+arr['height']+"'>";
range.pasteHTML(imagestring);
}
else HtmlEdit.focus();
}
//-->
</SCRIPT>
var arr = showModalDialog("InsertPic.aspx?<%=Request.QueryString%>", window,"dialogWidth:300px; dialogHeight:200px;help:0;status:0;resizeable:1");
返回InsertPic.aspx这个页面的值?这个不懂是什么意思,可以解释下吗? InsertPic.aspx?<%=Request.QueryString%>
-------------------
是获得Request.QueryString传递过来的参数.
如:页面:aaa.aspx?id=1&id2=3
这样一来Request.QueryString = "id=1&id2=2";