-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathjavascript.js
More file actions
52 lines (39 loc) · 1.2 KB
/
Copy pathjavascript.js
File metadata and controls
52 lines (39 loc) · 1.2 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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
function parse() {
var username = (document.cookie).trim();
var temp = '';
//position of username inside the cookies
var usernamePosition = username.indexOf("username=") + 9;
while(username[usernamePosition] != ';' && username.length > usernamePosition)
{
temp += username[usernamePosition];
usernamePosition++;
}
username = temp;
return username;
}
function parseSender() {
var username = (document.cookie).trim();
var temp = '';
//position of username inside the cookies
var usernamePosition = username.indexOf("sender=") + 7;
while(username[usernamePosition] != ';' && username.length > usernamePosition)
{
temp += username[usernamePosition];
usernamePosition++;
}
username = temp;
return username;
}
function parseMessage() {
var username = (document.cookie).trim();
var temp = '';
//position of username inside the cookies
var usernamePosition = username.indexOf("message=") + 8;
while(username[usernamePosition] != ';' && username.length > usernamePosition)
{
temp += username[usernamePosition];
usernamePosition++;
}
username = temp;
return username;
}