diff options
author | Peter Bengtsson <mail@peterbe.com> | 2020-12-08 14:41:45 -0500 |
---|---|---|
committer | Peter Bengtsson <mail@peterbe.com> | 2020-12-08 14:41:45 -0500 |
commit | 1109132f09d75da9a28b649c7677bb6ce07c40c0 (patch) | |
tree | 0dd8b084480983cf9f9680e8aedb92782a921b13 /files/es/web/api/location/origin | |
parent | 4b1a9203c547c019fc5398082ae19a3f3d4c3efe (diff) | |
download | translated-content-1109132f09d75da9a28b649c7677bb6ce07c40c0.tar.gz translated-content-1109132f09d75da9a28b649c7677bb6ce07c40c0.tar.bz2 translated-content-1109132f09d75da9a28b649c7677bb6ce07c40c0.zip |
initial commit
Diffstat (limited to 'files/es/web/api/location/origin')
-rw-r--r-- | files/es/web/api/location/origin/index.html | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/files/es/web/api/location/origin/index.html b/files/es/web/api/location/origin/index.html new file mode 100644 index 0000000000..4e019a68f0 --- /dev/null +++ b/files/es/web/api/location/origin/index.html @@ -0,0 +1,56 @@ +--- +title: 'Location: origin' +slug: Web/API/Location/origin +tags: + - API + - Location + - Propiedad + - Referencia + - Ubicación +translation_of: Web/API/Location/origin +--- +<p>{{APIRef("Location")}}</p> + +<p><span class="seoSummary">La propiedad de sólo-lectura <strong><code>origin</code></strong> de la interfaz {{domxref("Location")}} es una {{domxref("USVString")}} que contiene la serialización Unicode del origen de la URL que representa</span>; que es:</p> + +<ul> + <li>para una URL que usa <code>http</code> o <code>https</code>, el esquema seguido de <code>'://'</code>, seguido del dominio, seguido de <code>':'</code>, seguido del puerto (el puerto por defecto, <code>80</code> y <code>443</code> respectivamente, si se indica de forma explícita);</li> + <li>para una URL que usa <code>file:</code> esquema, el valor es independiente del navegador;</li> + <li>para una URL que usa <code>blob:</code> esquema, el origen de la URL seguido de <code>blob:</code>. Ej. <code>"blob:https://mozilla.org"</code> tendrá <code>"https://mozilla.org".</code></li> +</ul> + +<p>{{AvailableInWorkers}}</p> + +<h2 id="Sintaxis">Sintaxis</h2> + +<pre class="syntaxbox notranslate"><em>string</em> = <em>object</em>.origin; +</pre> + +<h2 id="Ejemplos">Ejemplos</h2> + +<pre class="brush: js notranslate">// En esta página, devuelve el origen +var result = window.location.origin; // Devuelve:'https://developer.mozilla.org' +</pre> + +<h2 id="Especificaciones">Especificaciones</h2> + +<table class="standard-table"> + <tbody> + <tr> + <th scope="col">Especificación</th> + <th scope="col">Estado</th> + <th scope="col">Comentario</th> + </tr> + <tr> + <td>{{SpecName('HTML WHATWG', '#dom-location-origin', 'origin')}}</td> + <td>{{Spec2('HTML WHATWG')}}</td> + <td>Definición inicial.</td> + </tr> + </tbody> +</table> + +<h2 id="Compatibilidad_en_navegadores">Compatibilidad en navegadores</h2> + + + +<p>{{Compat("api.Location.origin")}}</p> |