Simple posting tests. This is not part of the Seamonkey build.
git-svn-id: svn://10.0.0.236/trunk@73602 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
22
mozilla/extensions/xmlextras/tests/post.html
Normal file
22
mozilla/extensions/xmlextras/tests/post.html
Normal file
@@ -0,0 +1,22 @@
|
||||
<html>
|
||||
<body>
|
||||
<h1>Posting test</h1>
|
||||
<script>
|
||||
var x = document.implementation.createDocument("", "test", null);
|
||||
x.documentElement.appendChild(document.createTextNode("Foo"));
|
||||
|
||||
var p = new XMLHttpRequest();
|
||||
function myfunc()
|
||||
{
|
||||
var s = new XMLSerializer()
|
||||
var d = p.responseXML;
|
||||
str = s.serializeToString(d);
|
||||
alert(str);
|
||||
alert(p.getAllResponseHeaders());
|
||||
}
|
||||
p.onload = myfunc;
|
||||
p.open("POST", "http://blueviper/cgi-bin/time2.cgi");
|
||||
p.send(x);
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
18
mozilla/extensions/xmlextras/tests/syncpost.html
Normal file
18
mozilla/extensions/xmlextras/tests/syncpost.html
Normal file
@@ -0,0 +1,18 @@
|
||||
<html>
|
||||
<body>
|
||||
<h1>Posting test</h1>
|
||||
<script>
|
||||
var x = document.implementation.createDocument("", "test", null);
|
||||
x.documentElement.appendChild(document.createTextNode("Foo"));
|
||||
|
||||
var p = new XMLHttpRequest();
|
||||
p.open("POST", "http://blueviper/cgi-bin/time2.cgi", false);
|
||||
p.send(x);
|
||||
var d = p.responseXML;
|
||||
var s = new XMLSerializer()
|
||||
str = s.serializeToString(d);
|
||||
alert(str);
|
||||
alert(p.getAllResponseHeaders());
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user