-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Expand file tree
/
Copy pathSchemeTest.html
More file actions
60 lines (52 loc) · 1.7 KB
/
SchemeTest.html
File metadata and controls
60 lines (52 loc) · 1.7 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
52
53
54
55
56
57
58
59
60
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>Scheme Handler Test</title>
<script type="text/javascript">
var htmlNode;
var newLine = "\n";
var showError = function (text)
{
if (!htmlNode)
{
htmlNode = document.createElement("div");
htmlNode.id = "debugWindow";
document.body.appendChild(htmlNode);
}
htmlNode.innerHTML += "<p>" + text + "</p>";
};
var doRequest = function ()
{
var data = new FormData();
data.append('name', 'test');
data.append('value', 'anotherValue');
var x = new XMLHttpRequest();
x.open("POST", "PostDataAjaxTest.html", true);
//Send the proper header information along with the request
x.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
x.onload = function ()
{
showError(x.responseText);
};
x.onerror = function (e)
{
showError(e);
};
x.send(data);
};
</script>
</head>
<body>
<h1>Success</h1>
<p>Scheme Handler Functioned Correctly</p>
<form action="custom://cefsharp/PostDataTest.html" method="post" target="_blank">
User:<input type="text" name="user" value="lion" />
<br>
Pass:<input type="text" name="pass" value="123" />
<br>
<input type="submit" value="Test POST Data" />
</form>
<h1>Custom Post using Ajax</h1>
<button onclick="doRequest(); return false;">Submit via ajax</button>
</body>
</html>