-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathindex.html
31 lines (28 loc) · 959 Bytes
/
index.html
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
<html>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
<script type="text/javascript" src="cors.js"></script>
<script type="text/javascript">
function testGet()
{
getCORS('http://ucommbieber.unl.edu/CORS/cors.php', null, function(data){alert(data);});
}
function testPost(form)
{
postCORS('http://ucommbieber.unl.edu/CORS/cors.php', {name: form.name.value}, function(data){alert(data);});
}
</script>
<body>
<h1>CORS Examples</h1>
<p>Test GET
This page retrieves content from another server, using CORS<br />
<a href="#" onclick="testGet(); return false;">Get content from another server</a>
</p>
<p>Test POST:
<form action="#" onsubmit="testPost(this); return false">
Name: <input type="text" name="name" />
<input type="submit" />
</form>
</p>
<a href="http://saltybeagle.com/2009/09/cross-origin-resource-sharing-demo/">More info</a>
</body>
</html>