Jquery 如何将表格行链接到另一个框架?

Jquery 如何将表格行链接到另一个框架?,jquery,html,Jquery,Html,我正在使用jQuery,希望将表行链接到另一个目标帧 表行: <tr data-href="home.html" target="content"><td><h3><center>Home</h3></td></tr> 但它会在同一帧中打开链接。当设置window.location属性时,它会更改当前窗口的位置,而不是任何特定帧的位置。 假设您有一个且name属性设置为“content”,则需要将单击功能更改为

我正在使用jQuery,希望将表行链接到另一个目标帧

表行:

<tr data-href="home.html" target="content"><td><h3><center>Home</h3></td></tr>

但它会在同一帧中打开链接。

当设置
window.location
属性时,它会更改当前窗口的位置,而不是任何特定帧的位置。

假设您有一个
name
属性设置为“content”,则需要将
单击功能更改为:

jQuery(文档).ready(函数(){
美元(「tr」)在({
单击:函数(){
$(“iframe[name='content']”)attr(“src”,$(this.data(“href”));
$(this.css(“背景色”、“蓝色”);
}
})
});
jQuery(document).ready(function() {
    $("tr").on({
        click: function() {
            window.location = $(this).data("href");
            $(this).css("background-color","blue");
        }
    });
});