Note that there are some explanatory texts on larger screens.

plurals
  1. POGetElementsBy ... (javascript)
    primarykey
    data
    text
    <p>I want to get the href value of the link that has rel='edit', i am wondering how i can do it.</p> <pre><code>&lt;link rel='self' type='application/atom+xml' href='https://spreadsheets.google.com/feeds/****'/&gt; &lt;link rel='edit' type='application/atom+xml' href='https://spreadsheets.google.com/feeds/****'/&gt; </code></pre> <p>I am trying</p> <pre><code>this.url = entry.getElementsByTagName('link')[1].getAttribute('href'); </code></pre> <p>but i get href of the first link.</p> <p>thanks.</p> <p><strong>EDIT :</strong></p> <p>now what i don't understand is thateven when i am sure i get the right link, the href value is not what i expect</p> <pre><code>&lt;link rel='self' type='application/atom+xml' href='https://spreadsheets.google.com/feeds/list/**********/full/ba0fz'/&gt; &lt;link rel='edit' type='application/atom+xml' href='https://spreadsheets.google.com/feeds/list/**********/full/ba0fz/27mpei328jki4e'/&gt; </code></pre> <p>what i want is to do a regex on the href i want to get the "27mpei328jki4e" but instead of getting the full url, i get the short one, do you have any idea of why i get this result? no matter what method i use, neither the queryselector nor getElementsByTagName.</p> <p>my document is an xml</p> <pre><code>&lt;?xml version='1.0' encoding='UTF-8'?&gt; &lt;entry xmlns='http://www.w3.org/2005/Atom' xmlns:gsx='http://schemas.google.com/spreadsheets/2006/extended'&gt; &lt;id&gt;************&lt;/id&gt; &lt;updated&gt;2013-06-06T17:38:25.749Z&lt;/updated&gt; &lt;category scheme='http://schemas.google.com/spreadsheets/2006' term='http://schemas.google.com/spreadsheets/2006#list'/&gt; &lt;title type='text'&gt;30/05/2013 17:12:42&lt;/title&gt;&lt;content type='text'&gt; timeprocess: 01/01/1900, useroid: ICCOM-00000327, &lt;/content&gt; &lt;link rel='self' type='application/atom+xml' href='https://spreadsheets.google.com/**********/full/ba0fz'/&gt; &lt;link rel='edit' type='application/atom+xml' href='https://spreadsheets.google.com/**********/full/ba0fz/27mpei328jki4e'/&gt; &lt;gsx:time&gt;30/05/2013 17:12:42&lt;/gsx:time&gt; &lt;gsx:timeprocess&gt;01/01/1900&lt;/gsx:timeprocess&gt; &lt;gsx:useroid&gt;ICCOM-00000327&lt;/gsx:useroid&gt; &lt;/entry&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload