Revision 462545 of URLUtilsReadOnly

  • Revision slug: Web/API/URLUtilsReadOnly
  • Revision title: URLUtilsReadOnly
  • Revision id: 462545
  • Created:
  • Creator: teoli
  • Is current revision? No
  • Comment

Revision Content

{{SeeCompatTable}}

The URLUtilsReadOnly interface defines utility methods to work with URL. It defines only non-modifying methods intended to be used on data that cannot be changed.

There are no object of this type, but several interface are implemented it, like {{domxref("WorkerLocation")}}.

Properties

This interface doesn't inherit any property

{{domxref("URLUtilsReadOnly.href")}} {{readOnlyInline}}
Is a {{domxref("DOMString")}} containing the whole URL.
{{domxref("URLUtilsReadOnly.protocol")}} {{readOnlyInline}}
Is a {{domxref("DOMString")}} containing the protocol scheme of the URL, including the final ':'.
{{domxref("URLUtilsReadOnly.host")}} {{readOnlyInline}}
Is a {{domxref("DOMString")}} containing the host, that is the hostname, a ':', and the port of the URL.
{{domxref("URLUtilsReadOnly.hostname")}} {{readOnlyInline}}
Is a {{domxref("DOMString")}} containing the domain of the URL.
{{domxref("URLUtilsReadOnly.port")}} {{readOnlyInline}}
Is a {{domxref("DOMString")}} containing the port number of the URL.
{{domxref("URLUtilsReadOnly.pathname")}} {{readOnlyInline}}
Is a {{domxref("DOMString")}} containing an initial '/' followed by the path of the URL.
{{domxref("URLUtilsReadOnly.search")}} {{readOnlyInline}}
Is a {{domxref("DOMString")}} containing a '?' followed by the parameters of the URL.
{{domxref("URLUtilsReadOnly.hash")}} {{readOnlyInline}}
Is a {{domxref("DOMString")}} containing a '#' followed by the fragment identifier of the URL.

Methods

This interface doesn't inherit any method.

{{domxref("URLUtilsReadOnly.toString()")}}
Returns a {{domxref("DOMString")}} containing the whole URL. It is a synonym for {{domxref("URLUtilsReadOnly.href")}}.

Specifications

Specification Status Comment
{{SpecName('URL', '#urlutilsreadonly', 'URLUtilsReadOnly')}} {{Spec2('URL')}} Initial definition

Browser compatibility

{{ CompatibilityTable() }}

Feature Chrome Firefox (Gecko) Internet Explorer Opera Safari
Basic support {{CompatNo}} [1] {{CompatGeckoDesktop("1.9.1")}} {{CompatNo}} [1] {{CompatNo}} [1] {{CompatNo}} [1]
Feature Android Chrome for Android Firefox Mobile (Gecko) IE Mobile Opera Mobile Safari Mobile
Basic support {{CompatNo}} [1] {{CompatNo}} [1] {{CompatGeckoMobile("1.9.1")}} {{CompatNo}} [1] {{CompatNo}} [1] {{CompatNo}} [1]

[1] Though not grouped in a single abstract interface, these methods are directly available on the interfaces that implement it, if this interface is supported.

See also

  • Other URL-related interfaces: {{domxref("URL")}}, {{domxref("URLUtils")}}, and {{domxref("URLQuery")}}.
  • Interfaces implementing this one: {{domxref("WorkerLocation")}}.

Revision Source

<p>{{SeeCompatTable}}</p>
<p>The <strong><code>URLUtilsReadOnly</code></strong> interface defines utility methods to work with URL. It defines only non-modifying methods intended to be used on data that cannot be changed.</p>
<p>There are no object of this type, but several interface are implemented it, like {{domxref("WorkerLocation")}}.</p>
<h2 id="Properties">Properties</h2>
<p><em>This interface doesn't inherit any property</em></p>
<dl>
  <dt>
    {{domxref("URLUtilsReadOnly.href")}} {{readOnlyInline}}</dt>
  <dd>
    Is a {{domxref("DOMString")}} containing the whole URL.</dd>
  <dt>
    {{domxref("URLUtilsReadOnly.protocol")}} {{readOnlyInline}}</dt>
  <dd>
    Is a {{domxref("DOMString")}} containing the protocol scheme of the URL, including the final <code>':'</code>.</dd>
  <dt>
    {{domxref("URLUtilsReadOnly.host")}} {{readOnlyInline}}</dt>
  <dd>
    Is a {{domxref("DOMString")}} containing the host, that is the <em>hostname</em>, a <code>':'</code>, and the <em>port</em> of the URL.</dd>
  <dt>
    {{domxref("URLUtilsReadOnly.hostname")}} {{readOnlyInline}}</dt>
  <dd>
    Is a {{domxref("DOMString")}} containing the domain of the URL.</dd>
  <dt>
    {{domxref("URLUtilsReadOnly.port")}} {{readOnlyInline}}</dt>
  <dd>
    Is a {{domxref("DOMString")}} containing the port number of the URL.</dd>
  <dt>
    {{domxref("URLUtilsReadOnly.pathname")}} {{readOnlyInline}}</dt>
  <dd>
    Is a {{domxref("DOMString")}} containing an initial <code>'/'</code> followed by the path of the URL.</dd>
  <dt>
    {{domxref("URLUtilsReadOnly.search")}} {{readOnlyInline}}</dt>
  <dd>
    Is a {{domxref("DOMString")}} containing a <code>'?'</code> followed by the parameters of the URL.</dd>
  <dt>
    {{domxref("URLUtilsReadOnly.hash")}} {{readOnlyInline}}</dt>
  <dd>
    Is a {{domxref("DOMString")}} containing a <code>'#'</code> followed by the fragment identifier of the URL.</dd>
</dl>
<h2 id="Methods">Methods</h2>
<p><em>This interface doesn't inherit any method.</em></p>
<dl>
  <dt>
    {{domxref("URLUtilsReadOnly.toString()")}}</dt>
  <dd>
    Returns a {{domxref("DOMString")}} containing the whole URL. It is a synonym for {{domxref("URLUtilsReadOnly.href")}}.</dd>
</dl>
<h2 id="Specifications">Specifications</h2>
<table class="standard-table">
  <thead>
    <tr>
      <th scope="col">Specification</th>
      <th scope="col">Status</th>
      <th scope="col">Comment</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>{{SpecName('URL', '#urlutilsreadonly', 'URLUtilsReadOnly')}}</td>
      <td>{{Spec2('URL')}}</td>
      <td>Initial definition</td>
    </tr>
  </tbody>
</table>
<h2 id="Browser_compatibility">Browser compatibility</h2>
<p>{{ CompatibilityTable() }}</p>
<div id="compat-desktop">
  <table class="compat-table">
    <tbody>
      <tr>
        <th>Feature</th>
        <th>Chrome</th>
        <th>Firefox (Gecko)</th>
        <th>Internet Explorer</th>
        <th>Opera</th>
        <th>Safari</th>
      </tr>
      <tr>
        <td>Basic support</td>
        <td>{{CompatNo}} [1]</td>
        <td>{{CompatGeckoDesktop("1.9.1")}}</td>
        <td>{{CompatNo}} [1]</td>
        <td>{{CompatNo}} [1]</td>
        <td>{{CompatNo}} [1]</td>
      </tr>
    </tbody>
  </table>
</div>
<div id="compat-mobile">
  <table class="compat-table">
    <tbody>
      <tr>
        <th>Feature</th>
        <th>Android</th>
        <th>Chrome for Android</th>
        <th>Firefox Mobile (Gecko)</th>
        <th>IE Mobile</th>
        <th>Opera Mobile</th>
        <th>Safari Mobile</th>
      </tr>
      <tr>
        <td>Basic support</td>
        <td>{{CompatNo}} [1]</td>
        <td>{{CompatNo}} [1]</td>
        <td>{{CompatGeckoMobile("1.9.1")}}</td>
        <td>{{CompatNo}} [1]</td>
        <td>{{CompatNo}} [1]</td>
        <td>{{CompatNo}} [1]</td>
      </tr>
    </tbody>
  </table>
</div>
<p>[1] Though not grouped in a single abstract interface, these methods are directly available on the interfaces that implement it, if this interface is supported.</p>
<h2 id="See_also">See also</h2>
<ul>
  <li>Other URL-related interfaces: {{domxref("URL")}}, {{domxref("URLUtils")}}, and {{domxref("URLQuery")}}.</li>
  <li>Interfaces implementing this one: {{domxref("WorkerLocation")}}.</li>
</ul>
<dl>
  <br />
</dl>
Revert to this revision