forked from sagarvd01/Poc
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCors.html
More file actions
36 lines (36 loc) · 875 Bytes
/
Cors.html
File metadata and controls
36 lines (36 loc) · 875 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>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
</head>
<body>
<input id="url" />
<button id="btn" type="button">Submit</button>
<input id="urlwoc" />
<button id="btnwoc" type="button">Submit</button>
<div id="result"></div>
<div id="result"></div>
<script>
$('#btn').on('click',() =>{
console.log($('#url').val());
$.ajax({
type:"GET",
url : $('#url').val(),
xhrFields:{
withCredentials: true
},
success:(data)=> $('#result').text(data)
});
});
//woc -> without credentials
$('#btnwoc').on('click',() =>{
console.log($('#urlwoc').val());
$.ajax({
type:"GET",
url : $('#urlwoc').val(),
success:(data)=> $('#result').text(data)
});
});
</script>
</body>
</html>