簡単な JQuery ソリューションを使用して、リンクから href を取得し、クリック イベントに適用しています。これは Webkit および Gecko ブラウザーで機能しますが、Internet Explorer (7 & 8) では href の場所がundefinedとして表示され続けます。誰でもこれを修正できますか?これを解決するのを手伝ってもらえますか? もしそうなら大歓迎です。
$('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;
}
);
HTML は単純です。
<tr class="QRG">
<td class="blue"><a href="#QRG">QRG</a></td>
<td>Company Sale</td>
<td>Technology</td>
</tr>
<div class="deal" id="QRG">
<p><span class="js">Overview</span><span class="no-js">Enham</span></p>
<div class="deal-holder">
<div class="image-holder">
<img src="../assets/images/enham.gif" alt="" height="70" width="150" />
</div>
<p>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</p>
<a class="moreInfo" href="individual.html">More Information</a>
</div>
</div>