我怎样才能使用“a”;rel";javascript生成的表上的属性?
好的,所以我很难表达这个问题,所以我会尽我所能描述这个问题。我正在将这段代码转换为一段代码,该代码通过单击一个图像打开一个首选项覆盖,通过单击许多表行中的一行打开一个覆盖 代码涉及这两个文件(但它们不是项目中唯一的文件)我怎样才能使用“a”;rel";javascript生成的表上的属性?,javascript,jquery,Javascript,Jquery,好的,所以我很难表达这个问题,所以我会尽我所能描述这个问题。我正在将这段代码转换为一段代码,该代码通过单击一个图像打开一个首选项覆盖,通过单击许多表行中的一行打开一个覆盖 代码涉及这两个文件(但它们不是项目中唯一的文件) index.html Table.js根据JSP生成的信息生成一个表,即使rel属性成功设置为“#mies1”,单击也不起作用。但是,如果我在index.html中设置由纯html组成的表的rel,它就可以正常工作。我认为这与页面在完全生成表之前完成加载循环并运行覆盖代码有关
index.html
Table.js根据JSP生成的信息生成一个表,即使rel属性成功设置为“#mies1”,单击也不起作用。但是,如果我在index.html中设置由纯html组成的表的rel,它就可以正常工作。我认为这与页面在完全生成表之前完成加载循环并运行覆盖代码有关。这跟这事有关系吗?如何使生成的TR可单击?调用
$(“TR[rel]”)overlay()代码>在函数的末尾table4()
在将表加载到DOM中之后,是否尝试调用overlay()
函数?我想我的问题是确定表何时加载到DOM中,我真的不明白如何解决这个问题。不。我通过在周围生成一个标记使其工作,但现在所有内容都卡在第一列中。不过,现在可以点击了。
<div class="details">
<h3 align="center">Preferences</h3>
</div>
</div>
<script>
/* Overlay */
$(document).ready(function() {
$("tr[rel]").overlay();
});
</script>
<!-- <script src="js/jquery-1.3.2.min.js" type="text/javascript"></script> -->
<script src="js/jquery.qtip-1.0.0-rc3.min.js" type="text/javascript"></script>
<script src="js/jquery.qtip.debug.js" type="text/javascript"></script>
<script>
/* TOOL TIPS */
/* $(document).ready(function() {
$(#'milehf').qtip({
content: '100%',
style: {
width: 200,
padding: 5,
background: '#A2D959',
color: 'black',
textAlign: 'center',
border: {
width: 7,
radius: 5,
color: '#A2D959'
},
tip: 'bottomLeft',
name: 'dark' // Inherit the rest of the attributes from the preset dark style
}
});
});*/
</script>
$.ajax({
async:false,
dataType: "json",
url: "http://localhost:8080/JSP/connection2.jsp",
success: function(data){
cbspData = data;
console.log(cbspData[1].Satellite);
}
});
function table4()
{
console.log(cbspData[1].Satellite);
//alert(data2[1].id);
var thisDat = cbspData;
if (!document.getElementsByTagName) return;
tabBody=document.getElementById("mytable")
//tabBody=document.getElementsByTagName("TBODY").item(0);
//var Parent = tabBody.getElementsByTagName("TBODY");
while(tabBody.hasChildNodes())
{
tabBody.removeChild(tabBody.firstChild);
}
$.each(cbspData, function(i,dat){
row=document.createElement("TR");
row.setAttribute("number", dat.id);
row.id = "triggers";
row.rel="#mies1";
console.log(row.id);
console.log(row.rel);
//console.log(dat.Satellite);
document.createAttribute();
cell0 = document.createElement("TD");
cell0.innerHTML = dat.Mission;
//onMouseOver='alert(\"hello\"); document.getElementById(\"div" + i + "\").style.visibility = \"visible\";'
cell1 = document.createElement("TD");
cell1.innerHTML = dat.Satellite;
//$("#test-area table tbody tr:eq(" + i +") td:eq(0)").html(
// dat.id
//);
cell2 = document.createElement("TD");
cell2.innerHTML = dat.TerminalID;
// $("#test-area table tbody tr:eq(" + i +") td:eq(1)").html(
// dat.title
//);
cell3 = document.createElement("TD");
cell3.innerHTML = dat.Modem;
//$("#test-area table tbody tr:eq(" + i +") td:eq(2)").html(
// dat.subtitle
//);
cell4 = document.createElement("TD");
cell4.innerHTML = dat.Teleport;
//$("#test-area table tbody tr:eq(" + i +") td:eq(3)").html(
// dat.ranges
//);
cell5 = document.createElement("TD");
cell5.innerHTML = dat.ModemLock;
//textnode5=document.createTextNode(dat.measures);
//cell5.appendChild(textnode5);
row.appendChild(cell0);
row.appendChild(cell1);
row.appendChild(cell2);
row.appendChild(cell3);
row.appendChild(cell4);
row.appendChild(cell5);
tabBody.appendChild(row);
});
}