aardio 官方社区

 找回密码
 注册会员

QQ登录

只需一步,快速开始

搜索
查看: 11872|回复: 2

本地路径带文件,当字符串处理

[复制链接]

15

主题

21

回帖

447

积分

二级会员

积分
447
发表于 2018-4-3 21:58:19 | 显示全部楼层 |阅读模式
本帖最后由 ccbwx 于 2018-4-3 22:03 编辑

// window.showModalDialog(path ,obj,"...") 打开模太窗口 第一个参数 url 变成字符串没当文件处理?

mainForm.btnOpen.oncommand = function(id,event){
        //这个可以弹出子窗口,并显示子窗口内容
        //wb.go("/res/showMsg.html")
       
        //换成下面就不可以,文件名老是当字符串处理
        wb.html = /**
                <html>  
                    <head>
                        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />  
                        <title>无标题文档</title>  
                        <script type="text/javascript">
                        function oper()  
                           {
                                        //远程带http 可以弹出子窗口 并显示内容
                                           //var path ="http://www.baidu.com"
                                        //弹出子窗口显示 ok.html 这几个字符 ,不是显示ok.html里面的内容
                                           //var path = "ok.html"                               
                                        //弹出子窗口显示 /ok.html 这几个字符 ,不是显示ok.html里面的内容
                                        //var path = "/ok.html"                               
                                        //弹出子窗口显示 /res/ok.html 这几个字符 不是显示ok.html里面的内容
                                        //var path = "/res/ok.html"                       
                                        // 我把ok.html文件放在两个地方 /ok.html     资源目录  /res/ok.html  都放了一份
                                       
                                var zd = document.getElementById("txtReturnValue").value
                                var address = window.showModalDialog(path ,zd,"dialogHeight: 170px; dialogWidth: 320px;help: no;status: no;resizable: no; scroll:no;unadorned:on");
                                document.myform.txtReturnValue.value= address;  
                            }  
                        </script>
                    </head>  
                    <body>  
                       <form name="myform" method="post">  
                          <div>
                              <div>
                                  <input type="text" name="txtReturnValue" /><input type="button" name="xxx" value="子窗口" onclick="oper()" />
                              </div>
                          </div>
                       </form>  
                    </body>  
                </html>
        **/

4

主题

45

回帖

733

积分

三级会员

积分
733
发表于 2018-4-3 23:08:57 | 显示全部楼层
你为什么不能发个完整的代码?非要别人给你补全代码去执行,还是只想麻烦管理?

15

主题

21

回帖

447

积分

二级会员

积分
447
 楼主| 发表于 2018-4-3 23:51:57 | 显示全部楼层
好的,发个完整的,听人劝吃饱饭
import win.ui;

/*DSG{{*/
mainForm = win.form(text="aardio form";right=708;bottom=430)
mainForm.add(
btnOpen={cls="button";text="打开";left=150;top=4;right=316;bottom=27;z=2};
custom={cls="custom";text="custom";left=29;top=40;right=683;bottom=413;z=1}
)
/*}}*/

import web.form;
var wb = web.form( mainForm.custom,,,true);
wb.noScriptErr=true;



mainForm.show()


mainForm.btnOpen.oncommand = function(id,event){

        //wb.go("/res/showMsg.html")                //这个可以弹出子窗口,并显示内容
       
        wb.html = /**
                <html>  
                    <head>
                        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />  
                        <title>无标题文档</title>  
                        <script type="text/javascript">
                        function oper()  
                           {
                                   var path ="http://www.baidu.com"        //弹出子窗口显示 远程带http可以打开
                                   //var path = "ok.html"                                //弹出子窗口显示 ok.html 这几个字符 ,不是显示ok.html里面的内容
                                        //var path = "/ok.html"                                //弹出子窗口显示 /ok.html 这几个字符 ,不是显示ok.html里面的内容
                                        //var path = "/res/ok.html"                        //弹出子窗口显示 /res/ok.html 这几个字符 不是显示ok.html里面的内容
                                        // ok.html 确定是存放在资源目录里的!
                                       
                                var zd = document.getElementById("txtReturnValue").value
                                var address = window.showModalDialog(path ,zd,"dialogHeight: 350px; dialogWidth: 800px;help: no;status: no;resizable: no; scroll:no;unadorned:on");
                                document.myform.txtReturnValue.value= address;  
                            }  
                        </script>
                    </head>  
                    <body>  
                       <form name="myform" method="post">  
                          <div>
                              <div>
                                  <input type="text" name="txtReturnValue" /><input type="button" name="xxx" value="子窗口" onclick="oper()" />
                              </div>
                          </div>
                       </form>  
                    </body>  
                </html>
        **/
}
您需要登录后才可以回帖 登录 | 注册会员

本版积分规则

手机版|未经许可严禁引用或转载本站文章|aardio.com|aardio 官方社区 ( 皖ICP备09012014号 )

GMT+8, 2025-1-13 15:51 , Processed in 0.058817 second(s), 22 queries .

Powered by Discuz! X3.5

Copyright © 2001-2024 Tencent Cloud.

快速回复 返回顶部 返回列表