Repository navigation
Expand file tree
/
Copy pathSchemeTest.html
More file actions
62 lines (53 loc) · 1.74 KB
/
Copy pathSchemeTest.html
File metadata and controls
62 lines (53 loc) · 1.74 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
61
62
<!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 (data, contentType)
{
var x = new XMLHttpRequest();
x.open("POST", "custom://cefsharp/PostDataAjaxTest.html");
x.setRequestHeader("Accept", "application/json, text/javascript");
x.setRequestHeader("Content-Type", "application/json");
x.onreadystatechange = function (event)
{
if (x.readyState !== 4)
{
return;
}
showError(event.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('name=test&value=anotherValue'); return false;">Submit via ajax</button>
</body>
</html>