-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.html
More file actions
81 lines (57 loc) · 1.62 KB
/
Copy pathtest.html
File metadata and controls
81 lines (57 loc) · 1.62 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>测试页</title>
</head>
<body>
<hr>
POST:
<form action="http://localhost:8080/add" method="POST" >
<input type="text" name="json_data" value="1234567">
<input type="submit" value=" O K ">
</form>
<hr>
GET:
<form action="http://localhost:8080/add" method="GET" >
<input type="text" name="json_data" value="1234567">
<input type="submit" value=" O K ">
</form>
<hr>
window.open:
<input type="button" value=" OPEN " onclick="go_open()">
<script type="text/javascript">
var go_open = function(){
window.open("print_recipe.html", "Print",
"width=400,height=320,");
};
// 更简单直接的方法是,在地址栏输入 nw:version
var version_txt = process.versions['node-webkit'];
console.log(version_txt);
// 下面这部分代码,演示了如何添加 MENU 元素到 APP 中。有这些功能,写的APP就更像本地程序了。
// http://code.tutsplus.com/tutorials/introduction-to-html5-desktop-apps-with-node-webkit--net-36296
var gui = require("nw.gui");
var menu = new gui.Menu({ type: 'menubar' });
menu.append(new gui.MenuItem({
label: 'File',
submenu: new gui.Menu()
}));
menu.items[0].submenu.append(new gui.MenuItem({
label: 'New',
click: function () {
gui.Window.open('index.html');
}
}));
menu.items[0].submenu.append(new gui.MenuItem({
type: 'separator'
}));
menu.items[0].submenu.append(new gui.MenuItem({
label: 'Close',
click: function () {
gui.Window.get().close();
}
}));
gui.Window.get().menu = menu;
</script>
</body>
</html>