-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathloader.html
More file actions
36 lines (36 loc) · 1.27 KB
/
Copy pathloader.html
File metadata and controls
36 lines (36 loc) · 1.27 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
<!DOCTYPE html>
<html>
<head>
<script src="./jquery-3.1.1.min.js"></script>
</head>
<body>
<script>
$(document).ready(function(){
$.get("data.txt",function (data){
var rooms = data.split("\n");
var elem = "<svg id='mapview' width='400' height='180'>";
$.each(rooms,function(room){
var items = rooms[room].split(" ");
elem += "<rect id='";
elem +=items[0];
elem +="' width='";
elem +=items[1];
elem +="' height='";
elem +=items[2];
elem +="' x='";
elem +=items[3];
elem +="' y='";
elem +=items[4];
elem +="' style='fill:blue;stroke:pink;stroke-width:5;opacity:0.5' />";
});
elem +="</svg>";
//alert(elem);
$("#main").append(elem);
//$("#ali").css({fill:"red"})
},'text');
});
</script>
<p id='para'></p>
<div id='main'></div>
</body>
</html>