content/xml/tests/load/loadauth.html

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/content/xml/tests/load/loadauth.html	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,57 @@
     1.4 +<html>
     1.5 +<head>
     1.6 +<title>Synchronized document.load() test</title>
     1.7 +<style type="text/css">
     1.8 +.box {
     1.9 +  display: box;
    1.10 +  border: 1px solid black;
    1.11 +  margin-bottom: 0.5em;
    1.12 +}
    1.13 +.boxheader {
    1.14 +  font-weight: bold;
    1.15 +  color: maroon;
    1.16 +}
    1.17 +pre {
    1.18 +  margin-left: 2em;
    1.19 +}
    1.20 +</style>
    1.21 +<script type="text/javascript">
    1.22 +var xmlDoc = document.implementation.createDocument("", "test", null);
    1.23 +
    1.24 +function documentLoaded(e) {
    1.25 +  var s = new XMLSerializer();
    1.26 +  var str = s.serializeToString(xmlDoc);
    1.27 +  document.getElementById("id1").firstChild.nodeValue = str;
    1.28 +  var eventProperties = "";
    1.29 +  for (prop in e) {
    1.30 +    eventProperties += prop + " : '" + e[prop] + "'\n";
    1.31 +  }
    1.32 +  document.getElementById("id2").firstChild.nodeValue = 
    1.33 +    "Event object: " + e + "\n" +
    1.34 +    "Event properties:\n" + 
    1.35 +    eventProperties;
    1.36 +}
    1.37 +
    1.38 +xmlDoc.addEventListener("load", documentLoaded, false);
    1.39 +
    1.40 +function execute()
    1.41 +{
    1.42 +  netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
    1.43 +  xmlDoc.load("http://green/heikki/login/data.xml");
    1.44 +}
    1.45 +
    1.46 +</script>
    1.47 +</head>
    1.48 +<body onload="execute();">
    1.49 +<h1>Synchronized document.load() test</h1>
    1.50 +
    1.51 +<div class="box"><span class="boxheader">XML document serialized</span>
    1.52 +<pre id="id1">@@No result@@</pre>
    1.53 +</div>
    1.54 +<div class="box"><span class="boxheader">Event information</span>
    1.55 +<pre id="id2">@@No result@@</pre>
    1.56 +</div>
    1.57 +
    1.58 +</body>
    1.59 +</body>
    1.60 +</html>

mercurial