Note that there are some explanatory texts on larger screens.

plurals
  1. PO.attr('href') returning undefined
    primarykey
    data
    text
    <p>I am using a simple JQuery solution to get the href from a link and apply it to a click event. This works in Webkit and Gecko browsers, however Internet Explorer (7 &amp; 8) keeps displaying the href location as <strong>undefined</strong>. Anyone got a fix for this? Can help me solve this? Much appreciated if so. </p> <pre><code> $('table tr').click( function () { var element = $(this).attr("class"); var hrefLocation = $('#'+ element +' .deal-holder a').attr('href'); alert(hrefLocation) window.location.href = hrefLocation; return false; } ); </code></pre> <p>HTML is simple:</p> <pre><code> &lt;tr class="QRG"&gt; &lt;td class="blue"&gt;&lt;a href="#QRG"&gt;QRG&lt;/a&gt;&lt;/td&gt; &lt;td&gt;Company Sale&lt;/td&gt; &lt;td&gt;Technology&lt;/td&gt; &lt;/tr&gt; &lt;div class="deal" id="QRG"&gt; &lt;p&gt;&lt;span class="js"&gt;Overview&lt;/span&gt;&lt;span class="no-js"&gt;Enham&lt;/span&gt;&lt;/p&gt; &lt;div class="deal-holder"&gt; &lt;div class="image-holder"&gt; &lt;img src="../assets/images/enham.gif" alt="" height="70" width="150" /&gt; &lt;/div&gt; &lt;p&gt;Enham is a charity established in 1918, which delivers a wide range of essential services that provide choice and empowerment to disabled people to make their own decisions about their lives. Enham is a charity established in 1918, which delivers a wide range of essential services that provide choice and empowerment to disabled people to make their own decisions about their lives&lt;/p&gt; &lt;a class="moreInfo" href="individual.html"&gt;More Information&lt;/a&gt; &lt;/div&gt; &lt;/div&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    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.
    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