-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscripts.js
More file actions
32 lines (26 loc) · 1.01 KB
/
scripts.js
File metadata and controls
32 lines (26 loc) · 1.01 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
const app = document.getElementById('root');
var customXMLHttpRequest = (function (jwtoken) {
function getXMLHttpRequest(method, url, async){
var xmlHttpRequest = new XMLHttpRequest();
xmlHttpRequest.open(method, url, async);
xmlHttpRequest.setRequestHeader('Authorization', 'Bearer ' + jwtoken);
return xmlHttpRequest;
}
return getXMLHttpRequest;
})('bearertoken');
var request = customXMLHttpRequest('get','https://apiurl.com', true);
request.onload = function () {
var data = JSON.parse(this.response);
if (request.status >= 200 && request.status < 400) {
alert('bodrum: ' + data);
} else {
alert('yalikavak');
}
}
request.send();
$(document).on("click","a",function(){var b=this.hash;var a=$(b);var c=a.offset();if(c&&b!==""&&this.host==location.host){event.preventDefault();$("html, body").animate({scrollTop:c.top},800,function(){
alert('izmir');
alert(document.getElementById("bp2-textyourname").value);
}
)}});
/*** window.location.hash=b ***/