-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
55 lines (50 loc) · 1.61 KB
/
index.html
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
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>文档下载</title>
<script>
function Function1(){
var o1=document.getElementById("book");
var o2=document.getElementById("page");
var o3=document.getElementById("txt");
var pagenum=o2.value;
var room=o1.options[o1.selectedIndex].text;
if (room=='聚合物共混改性'){
o3.href="txt/共混/"+pagenum+".jpg.txt";
}
else
{
o3.href="txt/新编/"+pagenum+".jpg.txt";
}
}
function Function2(){
var o1=document.getElementById("book");
var o2=document.getElementById("page2");
var o3=document.getElementById("jpg");
var pagenum=o2.value;
var room=o1.options[o1.selectedIndex].text;
if (room=='聚合物共混改性'){
o3.href="jpg/共混/"+pagenum+".jpg";
}
else
{
o3.href="jpg/新编/"+pagenum+".jpg";
}
}
</script>
</head>
<body>
<p>选择一本书 </p>
<select id="book" style="width:500px;">
<option value="1">新编高聚物的结构与性能</option>
<option value="2" selected="selected">聚合物共混改性</option>
</select>
<p>输入文本页码</p>
<input type="text" id="page" placeholder="默认为聚合物共混改性第一页" onchange="Function1()"/>
<p>输入图片页码</p>
<input type="text" id="page2" placeholder="默认为聚合物共混改性第一页" onchange="Function2()"/>
<p><a href="txt/共混/1.jpg.txt" id="txt">下载文本</a></p>
<p><a href="jpg/共混/1.jpg" id="jpg">下载图片</a></p>
</body>
</html>