-
Notifications
You must be signed in to change notification settings - Fork 0
/
getAnchors.html
62 lines (57 loc) · 1.88 KB
/
getAnchors.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
56
57
58
59
60
61
62
<html>
<head>
<script src="anchorList.js"></script>
<script language="javascript">
var content;
function getNumofAnchors()
{
return anchorlist.length;
}
function CrawlSingleAnchor(index)
{
var Anchors = anchorlist;
var mycontent = "";
var i;
var j;
mycontent += "<Page>";
mycontent += "<Title>";
mycontent += XMLEncode(Anchors[index][0]);
mycontent += "</Title>";
mycontent += "<FileName>";
mycontent += XMLEncode(Anchors[index][1]);
mycontent += "</FileName>";
var SubAnchors = Anchors[index][2];
var subcontent = "";
for (j=0;j<SubAnchors.length;j++)
{
var Part = SubAnchors[j];
subcontent += "<Part>";
subcontent += "<Anchor>";
subcontent += XMLEncode(Part[0]);
subcontent += "</Anchor>";
subcontent += "<Title>";
subcontent += XMLEncode(Part[1]);
subcontent += "</Title>";
subcontent += "</Part>";
}
mycontent += subcontent;
mycontent += "</Page>";
return mycontent;
}
function XMLEncode(text)
{
var myText = new String(text);
myText = myText.replace(/</g,"<");
myText = myText.replace(/>/g,">");
myText = myText.replace(/&/g,"&");
myText = myText.replace(/""/g,""");
myText = myText.replace(/'/g,"' ");
return myText;
}
</script>
</head>
<body>
<div onclick="javascript:exportList();">Export</div>
<div id="content"></div>
</body>
</html>