lz.URL

JavaScript: lz.URL

Parses the protocol, host, port, path, file and query properties for the specified URL.

<canvas height="220" debug="true">
     <debug x="0" y="0" height="200" width="650"/>
     <script>
         var urlstring = 'http://localhost:8080/lps/lzurl_example.lzx?lzt=swf';
         var url = new lz.URL(urlstring);

         // list each part of this url
         Debug.debug("protocol: %w", url.protocol);
         Debug.debug("host: %w", url.host);
         Debug.debug("port: %w", url.port);
         Debug.debug("path: %w", url.path);
         Debug.debug("file: %w", url.file);
         Debug.debug("query: %w", url.query);
         
         // list the url
         Debug.debug("Complete URL: %w", url);
        
         // Make it secure
         url.protocol = 'https';
         url.port = 8443;
         Debug.debug("Secure URL: %w", url);
         
         // Change the query string
         url.query = 'lzt=source';
         Debug.debug("New path: %w", url);
     </script>
 </canvas>
http://www.ietf.org/rfc/rfc2396.txt specifies the syntax for a URI

Attributes

Name (CSS property) Type (tag) Type (js) Default Category
file       read/write
   
fragment       read/write
   
host       read/write
   
path       read/write
   
port       read/write
   
protocol       read/write
   
query       read/write
   

Methods

LzURL()
lz.URL.LzURL(url : String);
Parameter Name Type Description
url String URL to parse

parseURL()
lz.URL.parseURL(url : String);
Parses the protocol, host, port, path, file ,query and fragment properties for the specified URL.
Parameter Name Type Description
url String URL to parse

toString()
lz.URL.toString();
Returns this URL as a string

Class Methods

merge()
lz.URL.merge(url : lz.URL, defaults : lz.URL);
Returns URL merged with DEFAULTS as an lz.URL
Parameter Name Type Description
url lz.URL base URL
defaults lz.URL default URL
Returns Type Description
  lz.URL the merged URL