Diff for /books/www/chapters/ch05.html between versions 1.14 and 1.19

version 1.14, 2002/12/14 14:12:15 version 1.19, 2002/12/17 13:13:19
Line 1273  retval=OK; Line 1273  retval=OK;
     "77032"></a> <i>Scripting components from HTML</i></p>      "77032"></a> <i>Scripting components from HTML</i></p>
 <xmp>  <xmp>
 <html>  <html>
 <head>  <head>
   <title>Sound Service Play Example</title>    <title>Sound Service Play Example</title>
   <script>    <script>
     function play() {      function play() {
       netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");        netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
       var url = Components.classes["@mozilla.org/network/standard-url;1"].createInstance();        var sample = Components.classes["@mozilla.org/sound;1"].createInstance();
       url = url.QueryInterface(Components.interfaces.nsIURL);        sample = sample.QueryInterface(Components.interfaces.nsISound);
       url.spec = "resource:/res/samples/test.wav";        const SND_NETWORK_STD_CID = "@mozilla.org/network/standard-url;1";
       var sample = Components.classes["@mozilla.org/sound;1"].createInstance();        const SND_I_URL           = "nsIURL";
       sample = sample.QueryInterface(Components.interfaces.nsISound);        const SND_URL             = new  C.Constructor(SND_NETWORK_STD_CID, SND_I_URL);
       sample.playSystemSound('resource:/res/samples/test.wav');        var url                   = new SND_URL();
    }        url.spec                  = 'http://jslib.mozdev.org/test.wav';
   </script>        sample.play(url);
 </head>      }
 <body>    </script>
 <form name="form">  </head>
   <input type="button" value="Play Sound" onclick="play();">  <body>
 <form>    <form name="form">
 </body>      <input type="button" value="Play Sound" onclick="play();">
 </html>    </form>
   </body>
 </html>
 </xmp>  </xmp>
     <p>As in <a href="#77030">Example 5-10</a>, the classes[ ]      <p>As in <a href="#77030">Example 5-10</a>, the classes[ ]
     array on the special Mozilla <tt>Components</tt> object refers      array on the special Mozilla <tt>Components</tt> object refers

Removed from v.1.14  
changed lines
  Added in v.1.19


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>