准备工作
- 在nw.exe同目录下创建index.html和package.json
- 将下面的源码拷贝到对应文件中
- 将index.html和package.json打包成zip类型的文件
- 将zip文件拖动到nw.exe上
源码
index.html
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="refresh" content="10">
<meta http-equiv="refresh" content="5;url=http://www.cnblogs.com/aszx0413/articles/1886819.html">
</head>
<body>
<p>fhafkdal</p>
<a href="http://www.baidu.com"><input type="button">手动跳转</input></a>
script跳转
<script language="javascript" type="text/javascript">
window.location.href='http://www.baidu.com';
setTimeout("javascript:location.href='http://www.baidu.com'", 10);
</script>
</body>
</html>
package.json
{
"name": "url-goto",
"main": "index.html"
}
解释
![这里写图片描述](https://img-blog.csdn.net/20160518131237634)