mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-01-05 15:59:45 +00:00
Simple posting tests. This is not part of the Seamonkey build.
This commit is contained in:
parent
bb95d0ddd1
commit
bbd0c263ca
22
extensions/xmlextras/tests/post.html
Normal file
22
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
extensions/xmlextras/tests/syncpost.html
Normal file
18
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>
|
Loading…
Reference in New Issue
Block a user