forked from coolnameismy/dev-tips
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathuntitled.html
More file actions
36 lines (32 loc) · 694 Bytes
/
untitled.html
File metadata and controls
36 lines (32 loc) · 694 Bytes
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 lang="en">
<head>
<meta charset="UTF-8">
<title>test</title>
</head>
<body>
<script>
function test(){
var str = "<p><%= users %></p>";
var open = "<%";
for (var i = 0, len = str.length; i < len; ++i) {
var stri = str[i];
if (str.slice(i, open.length + i) == open) {
i += open.length;
log(i),log(str[i]);
// ', escape((1, )), ';
}
}
}
function log(msg){
console.log("|" + msg + "|");
}
function find(c,str){
var n = 0,
lineno = 0;
while (~(n = str.indexOf(c, n))) n++, lineno++,log(n),log(lineno);
}
test();
</script>
</body>
</html>