| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 907 人关注过本帖
标题:模态谈出窗口,知道的都进来看一下,先谢过了!
只看楼主 加入收藏
KASSAR
Rank: 1
等 级:新手上路
帖 子:7
专家分:0
注 册:2005-10-22
收藏
 问题点数:0 回复次数:2 
模态谈出窗口,知道的都进来看一下,先谢过了!

我用模态弹出窗口上传图片,然后记下图片路径,传回来的值url显示出来:E:\wwwroot\asp\staticHTML\news\pub\014.jpg 接受返回值的代码如下: function addImage() { var url=showModalDialog("upload.aspx","",""); if(url!="") { oID.document.execCommand('InsertImage',false,url); }

} 每次都是参数错误,url的路径没错啊,难道execCommand('InsetImage',false,图片路径)这个图片路径参数严格要求什么格式或类型吗?

搜索更多相关主题的帖子: 模态 窗口 路径 url false 
2005-10-24 23:51
islet
Rank: 12Rank: 12Rank: 12
等 级:贵宾
威 望:89
帖 子:6548
专家分:0
注 册:2005-1-28
收藏
得分:0 
[转载] [CODE]<HTML> <HEAD> <SCRIPT LANGUAGE="JScript"> /* *該function執行copy指令 */ function fn_doufucopy() { edit.select(); document.execCommand('Copy'); } /* *該function執行paste指令 */ function fn_doufupaste() { tt.focus(); document.execCommand('paste'); } --> </SCRIPT> </head> <body> <input id=edit value=范例><br> <button onclick=fn_doufucopy()>Copy</button> <button onclick=fn_doufupaste()>paste</button><br> <textarea id=tt rows=10 cols=50></textarea> </body> </html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=big5"> <meta name="GENERATOR" content="Microsoft FrontPage 4.0"> <meta name="ProgId" content="FrontPage.Editor.Document"> <title>execCommand整理</title> <script language=javascript> /* *該function用來創建一個超鏈結 */ function fn_creatlink() { document.execCommand('CreateLink',true,'true');//彈出一個對話框輸入URL //document.execCommand('CreateLink',false,'http://www.51js.com'); } /* *該function用來將選中的區塊設為指定的背景色 */ function fn_change_backcolor() { document.execCommand('BackColor',true,'#FFbbDD');//true或false都可以 } /* *該function用來將選中的區塊設為指定的前景色,改變選中區塊的字體大小,改變字體,字體變粗變斜 */ function fn_change_forecolor() { //指定前景色 document.execCommand('ForeColor',false,'#BBDDCC');//true或false都可以 //指定背景色 document.execCommand('FontSize',false,7); //true或false都可以 //字體必須是系統支持的字體 document.execCommand('FontName',false,'標楷體'); //true或false都可以 //字體變粗 document.execCommand('Bold'); //變斜體 document.execCommand('Italic'); } /* *該function用來將選中的區塊加上不同的線條 */ function fn_change_selection() { //將選中的文字加下劃線 document.execCommand('Underline'); //在選中的文字上劃粗線 document.execCommand('StrikeThrough'); //將選中的部分文字變細 document.execCommand('SuperScript'); //將選中區塊的下劃線取消掉 document.execCommand('Underline'); } /* *該function用來將選中的區塊排成不同的格式 */ function fn_format() { //有序列排列 document.execCommand('InsertOrderedList'); //實心無序列排列 document.execCommand('InsertUnorderedList'); //空心無序列排列 document.execCommand('Indent'); } /* *該function用來將選中的區塊剪下或是刪除掉 */ function fn_CutOrDel() { //刪除選中的區塊 //document.execCommand('Delete'); //剪下選中的區塊 document.execCommand('Cut'); } /* *該function用來將選中的區塊重設為一個相應的物件 */ function fn_InsObj() { /* ****************************************** * 以下指令都是為選中的區塊重設一個object; * 如沒有特殊說明,第二個參數true或false是一樣的; * 參數三表示為該object的id; * 可以用在javascript中通過其指定的id來控制它 ****************************************** */ /*重設為一個button(InsertButton和InsertInputButtong一樣, 隻不前者是button,後者是input)*/ /*document.execCommand('InsertButton',false,"aa"); //true或false無效 document.all.aa.value="風舞九天";*/ //重設為一個fieldset /*document.execCommand('InsertFieldSet',true,"aa"); document.all.aa.innerText="刀劍如夢";*/ //插入一個水平線 //document.execCommand('InsertHorizontalRule',true,"aa"); //插入一個iframe //document.execCommand('InsertIFrame',true,"aa"); //插入一個InsertImage,設為true時需要圖片,false時不需圖片 //document.execCommand('InsertImage',false,"aa"); //插入一個checkbox //document.execCommand('InsertInputCheckbox',true,"aa"); //插入一個file類型的object //document.execCommand('InsertInputFileUpload',false,"aa"); //插入一個hidden /*document.execCommand('InsertInputHidden',false,"aa"); alert(document.all.aa.id);*/ //插入一個InputImage /*document.execCommand('InsertInputImage',false,"aa"); document.all.aa.src="F-a10.gif";*/ //插入一個Password //document.execCommand('InsertInputPassword',true,"aa"); //插入一個Radio //document.execCommand('InsertInputRadio',false,"aa"); //插入一個Reset //document.execCommand('InsertInputReset',true,"aa"); //插入一個Submit //document.execCommand('InsertInputSubmit',false,"aa"); //插入一個input text //document.execCommand('InsertInputText',false,"aa"); //插入一個textarea //document.execCommand('InsertTextArea',true,"aa"); //插入一個 select list box //document.execCommand('InsertSelectListbox',false,"aa"); //插入一個single select document.execCommand('InsertSelectDropdown',true,"aa"); //插入一個line break(硬回車??) //document.execCommand('InsertParagraph'); //插入一個marquee /*document.execCommand('InsertMarquee',true,"aa"); document.all.aa.innerText="bbbbb";*/ //用於取消選中的陰影部分 //document.execCommand('Unselect'); //選中頁面上的所有元素 //document.execCommand('SelectAll'); } /* *該function用來將頁面保存為一個文件 */ function fn_save() { //第二個參數為欲保存的文件名 document.execCommand('SaveAs','mycodes.txt'); //打印整個頁面 //document.execCommand('print'); } </script> </head> <body> 浮沉聚散變化又再,但是總可卷土重來.<br> 天若有情天亦老,人間正道是滄桑.<br> 都怪我,太執著,卻也等不到花開葉落.<br> <input type=button value="創建CreateLink" onclick=fn_creatlink()><br> <input type=button value="改變文字背景色" onclick=fn_change_backcolor()><br> <input type=button value="改變文字前景色" onclick=fn_change_forecolor()><br> <input type=button value="給文字加線條" onclick=fn_change_selection()><br> <input type=button value="改變文字的排列" onclick=fn_format()><br> <input type=button value="刪除或剪下選中的部分" onclick=fn_CutOrDel()><br> <input type=button value="插入Object" onclick=fn_InsObj()><br> <input type=button value="保存或打印文件" onclick=fn_save()><br> <input type=button value="測試Refresh屬性" onclick="document.execCommand('Refresh')"> </body> </html>[/CODE]
2005-10-25 08:41
KASSAR
Rank: 1
等 级:新手上路
帖 子:7
专家分:0
注 册:2005-10-22
收藏
得分:0 
有点灵感了,谢谢版主
能给我说一下execCommand('InsertImage',false,url)
的详细用法吗

请举个例子

我的QQ是14558827 欢迎大家加我,一起学习
2005-10-25 09:05
快速回复:模态谈出窗口,知道的都进来看一下,先谢过了!
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.026344 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved