-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcategorylist.html
66 lines (59 loc) · 1.66 KB
/
categorylist.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
63
64
65
66
<html>
<head>
<script type="text/javascript" src = "js/jquery.js"></script>
<script type="text/javascript" src = "js/category.js"></script>
</head>
<style>
#newdiv{
position: relative;
left: 100px;
top:10px;
border: 5px solid red;
display: inline-block;
}
#subdiv{
position: relative;
left: 10px;
top:20px;
border: 2px solid green;
display: inline-block;
}
</style>
<body>
<div id="list">
</div>
<script>
//alert(category.response.categories.length);
var nocat=0;
var nosubcat=0;
var nosubsubcat=0;
var total=0
for(j=0; j<category.response.categories.length;j++){
nocat++;
$('#list').append(j+'.'+category.response.categories[j].name+'('+category.response.categories[j].id+')');
$('#list').append('<br><br>');
for(i=0; i<category.response.categories[j].categories.length;i++){
nosubcat++;
total++;
$('#list').append('----'+j+'.'+i+' '+category.response.categories[j].categories[i].name+'('+category.response.categories[j].categories[i].id+')');
$('#list').append('<br>');
if(category.response.categories[j].categories[i].categories.length!=0){
total--;
}
for(k=0; k<category.response.categories[j].categories[i].categories.length;k++){
nosubsubcat ++;
total++;
$('#list').append('----------'+j+'.'+i+'.'+k+' '+category.response.categories[j].categories[i].categories[k].name+'('+category.response.categories[j].categories[i].categories[k].id+')');
$('#list').append('<br>');
}
}
$('#list').append('<br>');
}
/*alert(nocat);
alert(nosubcat);
alert(nosubsubcat);*/
alert("total categories by name="+(nocat+nosubcat+nosubsubcat));
alert("total categories = "+(total-nocat));
</script>
</body>
</hmtl>