加载页面时自动打开另一个新页面的并同时打开一个exe程序

打开新页面
<SCRIPT>
  function OPENNEW(){
    window.open("path.jsp", "win2");
  }
</SCRIPT>

执行exe
<%@   page   language="java" contentType="text/html; charset=gb2312"  import="java.io.*"%>
<%      
 //当加载页面时,就自动打开聊天程序 jzl 2007-2-26
 try{
  String username =(String)session.getAttribute("user_name");
  String passwd = request.getParameter("password");
  
  //String strAbsPath=application.getRealPath("");
  //String exeName = strAbsPath+"SendUdp.exe "+username+" "+passwd+" ";
     
  Runtime runtime = Runtime.getRuntime();      
  runtime.exec("c://ESDQQ.exe "+username+" "+passwd+" ");
  
  //runtime.exec(exeName);
  
  //String strAbsPath=application.getRealPath("");
  //strAbsPath = strAbsPath + "//";
  //out.println(strAbsPath);
  
 }catch(Exception e){
  //提示加载聊天程序出错
  //out.print("<script>alert('加载聊天程序出错!');</script>");
  //转到下载页面
  out.print("<script>window.open('downloadqq.html', 'win2');</script>");
 }
%>    

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
好的,下面是一个简单的Chrome插件示例,它会在页面加载完成后自动向指定节点插入数据: 1. 创建一个新文件夹,命名为 "my-extension"。 2. 在 "my-extension" 文件夹中创建一个名为 "manifest.json" 的文件,并将以下内容复制到该文件中: ``` { "name": "My Extension", "version": "1.0", "manifest_version": 2, "description": "A simple extension that inserts data into a specific node on a page.", "content_scripts": [ { "matches": [ "<all_urls>" ], "js": [ "content.js" ] } ] } ``` 3. 在 "my-extension" 文件夹中创建一个名为 "content.js" 的文件,并将以下内容复制到该文件中: ``` // Wait for the page to finish loading window.addEventListener("load", function(event) { // Find the target node var targetNode = document.getElementById("target-node-id"); if (targetNode) { // Insert the data targetNode.insertAdjacentHTML("beforeend", "<p>Here is some data!</p>"); } }); ``` 4. 在 "my-extension" 文件夹中创建一个名为 "popup.html" 的文件,并将以下内容复制到该文件中: ``` <!DOCTYPE html> <html> <head> <title>My Extension</title> <script src="popup.js"></script> </head> <body> <h1>My Extension</h1> <p>Click the button to insert data into the target node.</p> <button id="insert-data">Insert Data</button> </body> </html> ``` 5. 在 "my-extension" 文件夹中创建一个名为 "popup.js" 的文件,并将以下内容复制到该文件中: ``` // Find the "Insert Data" button var insertDataButton = document.getElementById("insert-data"); // When the button is clicked, send a message to the content script to insert the data insertDataButton.addEventListener("click", function(event) { chrome.tabs.query({active: true, currentWindow: true}, function(tabs) { chrome.tabs.sendMessage(tabs[0].id, {action: "insertData"}); }); }); ``` 6. 在 Chrome 浏览器中打开 "chrome://extensions/" 页面。 7. 选择 "开发者模式",然后点击 "加载已解压的扩展程序" 按钮。 8. 选择 "my-extension" 文件夹,然后点击 "确定"。 现在,当你在浏览网页,可以单击插件图标并单击 "Insert Data" 按钮,以在页面中插入数据。请确保将 "target-node-id" 替换为实际要插入数据的节点的 ID。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值