zoukankan      html  css  js  c++  java
  • 添加IE右键菜单 以 调用和运行 自己的程序或文件

    本示例 接续 上篇
    VS2005 My.Computer.Registry 对象 操作注册表 简单示例
    实现 点击IE右键菜单的相关项后
    调用自己的程序
    打开一个 添加收藏 的对话框程序
    -----------
    (当然可以定义自己的其他相关操作
    比如向自己的网站的某个页面 进行提交等
    本次示例顺便示例了showModalDialog的参数传递)

    示例代码如下
    a.html 主要是中转作用
    b.html 才是我们自己的程序功能的重点所在

    a.html

    <html>
    <head></head>
    <script language="javascript" type="text/javascript">
        
    function load()
        
    {  
            
    //得到父窗口对象
            var parentWin = external.menuArguments;
            
            
    var winURL = parentWin.document.URL;
            
    var winTitle = parentWin.document.title;
            
            
    //构造参数数组
            paraArray = new Array();
            paraArray[
    0= winURL;
            paraArray[
    1= winTitle;
            
            window.showModalDialog(
    "b.html",paraArray,"dialogWidth=370px;dialogHeight=150px");
        }

    </script>

    <body onload="load();"></body>
    </html>

    b.html
    <html>
    <head>
    <title>添加收藏</title>
    </head>
    <script language="javascript" type="text/javascript">
        
    function load()
        
    {
            
    var paraArray = new Array();
            paraArray 
    = window.dialogArguments;
            
            document.all.Text2.value 
    = paraArray[0];
            document.all.Text3.value 
    = paraArray[1];
        }

        
    function postValue()
        
    {
            alert(
    "添加收藏");
        }

    </script>

    <body onload="load();">
        
    <form id="form1">
            
    <table>
                
    <tr>
                    
    <td>你的ID</td>
                    
    <td style=" 270px">
                        
    <input id="Text1" type="text" /></td>
                
    </tr>
                
    <tr>
                    
    <td>收藏地址</td>
                    
    <td><input id="Text2" type="text" style=" 260px" /></td>
                
    </tr>
                
    <tr>
                    
    <td>收藏名称</td>
                    
    <td><input id="Text3" type="text" style=" 260px" /></td>
                
    </tr>
                
    <tr>
                    
    <td colspan="2"  align="center">
                        
    <input id="Button1" type="button" value="确定" onclick="postValue();" />
                        
    <input id="Button2" type="button" value="取消" onclick="self.close();" />
                        
    </td>
                
    </tr>
            
    </table>
        
    </form>
    </body>

    </html>
  • 相关阅读:
    转 linux 内存释放
    转 功能强大的shell:if条件语句
    转 shell中$(( )) 与 $( ) 还有${ }的区别
    转 关于shell中if 语法结构的广泛误解
    配置vim插件遇到youcompleteme插件问题解决方案
    lucene关于IndexReader总结
    sql developer链接不上oracle 报 The Network Adapter could not establish the connection
    plsql数据库异常---plsql 登录后,提示数据库字符集(AL32UTF8)和客户端字符集(ZHS16GBK)不一致
    改修jquery支持cmd规范的seajs
    npm学习(十六)之package-lock.json和package.json的作用
  • 原文地址:https://www.cnblogs.com/freeliver54/p/598221.html
Copyright © 2011-2022 走看看