biuri.html

来自「ajax 框价.是个好工具.javascript 矿家.可以用在任何平台.」· HTML 代码 · 共 422 行

HTML
422
字号
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"><html><!--Generated using api.website.xsl version 2003-07-17--><head><META http-equiv="Content-Type" content="text/html; charset=utf-8"><title>BiUri</title><meta http-equiv="Content-Type" content="text/html; charset=utf-8"><link type="text/css" rel="stylesheet" href="api.css"><script type="text/javascript">				function showDerivedClasses() {					var ul = document.getElementById("api-derived-classes");					var lis = ul.childNodes;					var l = lis.length;					for (var i = 1; i < l; i++)						lis[i].style.display = "";					lis[0].style.display = "none";				}			</script></head><body><h1 id="BiUri">BiUri</h1><p>This class is used to define a Universal Resource Identifier (URI). This is sometimes also known as a Uniform Resource Locator (URL). A URI is used to describe the location and source of external files. A URI is only a representaion of the string format describing the URI. It does not know how to lookup the information the URI might point at.<br>				<br>		 A general URI has the following format. Below this is a list of what part of the URI maps to what property.<br>				<br>				<code>http://user:password@www.domain.com:80/dir/file.html?param0=value=0;param1=value1#fragment</code>		<br>				<br>				<code><a href="#scheme">scheme</a></code> - http<br>				<code><a href="#userInfo">userInfo</a></code> - user:password<br>				<code><a href="#host">host</a></code> - www.domain.com<br>				<code><a href="#port">port</a></code> - 80<br>				<code><a href="#path">path</a></code> - /dir/file.html<br>				<code><a href="#dirPath">dirPath</a></code> - /dir/<br>				<code><a href="#query">query</a></code> - ?param0=value=0;param1=value1 <code><a href="#fragment">fragment</a></code> - #fragment<br>				<code><a href="#getParam">getParam</a></code>("param0") - value0<br>				<code><a href="#getParam">getParam</a></code>("param1") - value1<br>				<code><a href="#href">href</a></code> - http://user:password@www.domain.com:80/dir/file.html?param0=value=0;param1=value1#fragment<br>			</p><p>This class extends		<code><a href="BiObject.html">BiObject</a></code>		and therefore all methods and fields available for		<code><a href="BiObject.html">BiObject</a></code>		are also available for <code>BiUri</code>.</p><ul class="partial-class-tree"><li><code><a href="BiObject.html">BiObject</a></code><ul><li><code>BiUri</code><ul id="api-derived-classes"></ul></li></ul></li></ul><h2>Constructor</h2><p><code>	new BiUri([<span class="methodArgument">sBase</span> [, <span class="methodArgument">sRel</span>]])</code></p><h3>Parameters</h3><table><thead><tr><td>Name</td><td>Type</td><td class="optional-header">Optional</td><td>Default</td><td>Descripton</td></tr></thead><tbody><tr><td><code>sBase</code></td><td><code class="type">String</code></td><td class="optional-column"><img src="check.png" alt="checked"></td><td></td><td>The base URI </td></tr><tr><td><code>sRel</code></td><td><code class="type">String</code></td><td class="optional-column"><img src="check.png" alt="checked"></td><td></td><td>The URI relative to the base URI. If this describes an absolute URI then the base URI will be replaced.</td></tr></tbody></table><h2>Properties</h2><table><thead><tr><td>Name</td><td>Type</td><td class="get-header">get</td><td class="set-header">set</td><td>Descripton</td></tr></thead><tbody><tr><td><a name="dirPath"></a><code>dirPath</code></td><td><code class="type">String</code></td><td class="get-column"><img src="check.png" alt="checked"></td><td class="set-column"></td><td>This is the part of the URI discribing the directory and it does not include the file name. This ends with a '/' if the path is available.</td></tr><tr><td><a name="fragment"></a><code>fragment</code></td><td><code class="type">String</code></td><td class="get-column"><img src="check.png" alt="checked"></td><td class="set-column"></td><td>This is all the text coming after (and including) the first '#' character.</td></tr><tr><td><a name="host"></a><code>host</code></td><td><code class="type">String</code></td><td class="get-column"><img src="check.png" alt="checked"></td><td class="set-column"></td><td>The name of the host (or domain) that the URI points at. For a mailto URI this is the part after the '@'.</td></tr><tr><td><a name="href"></a><code>href</code></td><td><code class="type">String</code></td><td class="get-column"><img src="check.png" alt="checked"></td><td class="set-column"><img src="check.png" alt="checked"></td><td>This is the complete string representation of the URI.</td></tr><tr><td><a name="path"></a><code>path</code></td><td><code class="type">String</code></td><td class="get-column"><img src="check.png" alt="checked"></td><td class="set-column"></td><td>This is the part of the URI that comes after the port. It includes the file part of URI if available.</td></tr><tr><td><a name="port"></a><code>port</code></td><td><code class="type">String</code></td><td class="get-column"><img src="check.png" alt="checked"></td><td class="set-column"></td><td>This is the port part of the URI.</td></tr><tr><td><a name="query"></a><code>query</code></td><td><code class="type">String</code></td><td class="get-column"><img src="check.png" alt="checked"></td><td class="set-column"></td><td>This is all the text coming after (and including) the first '?' character. If the URI has a fragment the fragment is not included in the query.</td></tr><tr><td><a name="scheme"></a><code>scheme</code></td><td><code class="type">String</code></td><td class="get-column"><img src="check.png" alt="checked"></td><td class="set-column"></td><td>The scheme is the first part of the URI and is the text before the first ':'. For example "http", "mailto" and "file" are common schemes.</td></tr><tr><td><a name="userInfo"></a><code>userInfo</code></td><td><code class="type">String</code></td><td class="get-column"><img src="check.png" alt="checked"></td><td class="set-column"></td><td>This is the part of the URI used to describe the user information. This is the part coming after the scheme but before the domain. This is empty when no user information is available.</td></tr></tbody></table><h2>Methods</h2><table><thead><tr><td>Name</td><td>Description</td></tr></thead><tbody><tr><td><code><a href="#addParam">addParam</a></code></td><td>Adds a param with a given name and value. This is similar to <code><a href="#setParam">setParam</a></code> except that it does not overwrite existing paramaters with the same name.</td></tr><tr><td><code><a href="#getParam">getParam</a></code></td><td>Gets the value for a param. This returns <code>undefined</code> if the param is not present. This returns <code>null</code> if the param is present but it does not have a value associated with it.</td></tr><tr><td><code><a href="#getParams">getParams</a></code></td><td>Returns all the params with the given name</td></tr><tr><td><code><a href="#hasParam">hasParam</a></code></td><td>Whether the URI has a param with the given name</td></tr><tr><td><code><a href="#removeParam">removeParam</a></code></td><td>Removes the params with the given param name</td></tr><tr><td><code><a href="#setParam">setParam</a></code></td><td>Sets the value for a param.</td></tr></tbody></table><h2>Events</h2><p>None.</p><h2>Static Methods</h2><p>None.</p><h2>Static Fields</h2><p>None.</p><h2>Remarks</h2><p>	</p><h2>Method Details</h2><h3><a name="addParam"></a>addParam</h3><p>Adds a param with a given name and value. This is similar to <code><a href="#setParam">setParam</a></code> except that it does not overwrite existing paramaters with the same name.</p><h4>Syntax</h4><pre class="method-syntax">object.addParam(<span class="methodArgument">sName</span>, <span class="methodArgument">sValue</span>)</pre><h4>Parameters</h4><table><thead><tr><td>Name</td><td>Type</td><td class="optional-header">Optional</td><td>Default</td><td>Descripton</td></tr></thead><tbody><tr><td><code>sName</code></td><td><code class="type">String</code></td><td class="optional-column"></td><td></td><td>The name of the param</td></tr><tr><td><code>sValue</code></td><td><code class="type">String</code></td><td class="optional-column"></td><td></td><td>The value of the param</td></tr></tbody></table><h4>Return Type</h4><p><code class="type">void</code></p><h3><a name="getParam"></a>getParam</h3><p>Gets the value for a param. This returns <code>undefined</code> if the param is not present. This returns <code>null</code> if the param is present but it does not have a value associated with it.</p><h4>Syntax</h4><pre class="method-syntax">object.getParam(<span class="methodArgument">sName</span>)</pre><h4>Parameters</h4><table><thead><tr><td>Name</td><td>Type</td><td class="optional-header">Optional</td><td>Default</td><td>Descripton</td></tr></thead><tbody><tr><td><code>sName</code></td><td><code class="type">String</code></td><td class="optional-column"></td><td></td><td>The name of the param</td></tr></tbody></table><h4>Return Type</h4><p><code class="type">String</code></p><h3><a name="getParams"></a>getParams</h3><p>Returns all the params with the given name</p><h4>Syntax</h4><pre class="method-syntax">object.getParams(<span class="methodArgument">sName</span>)</pre><h4>Parameters</h4><table><thead><tr><td>Name</td><td>Type</td><td class="optional-header">Optional</td><td>Default</td><td>Descripton</td></tr></thead><tbody><tr><td><code>sName</code></td><td><code class="type">String</code></td><td class="optional-column"></td><td></td><td>The name of the params to get.</td></tr></tbody></table><h4>Return Type</h4><p><code class="type">String[]</code></p><h3><a name="hasParam"></a>hasParam</h3><p>Whether the URI has a param with the given name</p><h4>Syntax</h4><pre class="method-syntax">object.hasParam(<span class="methodArgument">sName</span>)</pre><h4>Parameters</h4><table><thead><tr><td>Name</td><td>Type</td><td class="optional-header">Optional</td><td>Default</td><td>Descripton</td></tr></thead><tbody><tr><td><code>sName</code></td><td><code class="type">String</code></td><td class="optional-column"></td><td></td><td>The name of the param to check for</td></tr></tbody></table><h4>Return Type</h4><p><code class="type">Boolean</code></p><h3><a name="removeParam"></a>removeParam</h3><p>Removes the params with the given param name</p><h4>Syntax</h4><pre class="method-syntax">object.removeParam(<span class="methodArgument">sName</span>)</pre><h4>Parameters</h4><table><thead><tr><td>Name</td><td>Type</td><td class="optional-header">Optional</td><td>Default</td><td>Descripton</td></tr></thead><tbody><tr><td><code>sName</code></td><td><code class="type">String</code></td><td class="optional-column"></td><td></td><td>The name of the param to remove</td></tr></tbody></table><h4>Return Type</h4><p><code class="type">void</code></p><h3><a name="setParam"></a>setParam</h3><p>Sets the value for a param.</p><h4>Syntax</h4><pre class="method-syntax">object.setParam(<span class="methodArgument">sName</span>, <span class="methodArgument">sValue</span>)</pre><h4>Parameters</h4><table><thead><tr><td>Name</td><td>Type</td><td class="optional-header">Optional</td><td>Default</td><td>Descripton</td></tr></thead><tbody><tr><td><code>sName</code></td><td><code class="type">String</code></td><td class="optional-column"></td><td></td><td>The name of the param</td></tr><tr><td><code>sValue</code></td><td><code class="type">String</code></td><td class="optional-column"></td><td></td><td>The value of the param</td></tr></tbody></table><h4>Return Type</h4><p><code class="type">void</code></p></body></html>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?