我目前正在使用 jQuery Tools Tooltip。它在 IE8/Firefox 中工作,但客户端也需要它在 IE6 中工作。从我在他们网站上看到的一切,以及它在项目的其他地方工作的事实,我知道它与 IE6 兼容。
我相信挂断是因为我将工具提示附加到 AJAX 生成的表行列表。到目前为止,我已经尝试了这两种方法,这两种方法似乎都适用于 IE8/Firefox,但都不适用于 IE6。
尝试1:
$(document).ready(function() {
// get the undeclared additions and populate the table
$.getJSON("/Drm/Pc/GetUndeclaredAssistanceRecords?partnumber=<%= Model.PartNumber %>",
function(data) {
var rowEntry = "";
var rowClass = "odd";
for (var i = 0; i < data.length; i++) {
// Fix for Bug 71 starts
strComment = "";
for (var k = 0; k < data[i].Comment.length; k++) {
if (data[i].Comment.substring(k, k + 1) == "'")
strComment = strComment + "";
else
strComment = strComment + data[i].Comment.substring(k, k + 1);
}
strComment = strComment.replace(";", ",");
strComment = strComment.substring(0, 400);
var rowEntry = "<tr class='" + rowClass + "'><td class='pcassistresultsCenterAlign'>" + data[i].PurchaseOrder + "</td><td class='pcassistresultsLeftAlign'>" + data[i].SupplierName + "</td><td class='pcassistresultsCenterAlign'>" + data[i].Amount + "<td class='pcassistresultsCenterAlign'>" + data[i].RecordType + "</td></tr>";
rowEntry = rowEntry + "<tr class='" + rowClass + "'><td class='pcassistresultsDetailTitle'>Shipment Date:</td><td>" + data[i].ShipDate + "</td><td class='pcassistresultsDetailTitle'>Input On:</td><td class='pcassistresultsDetailData'>" + data[i].InputOn + "</td></tr>";
rowEntry = rowEntry + "<tr class='" + rowClass + "'><td class='pcassistresultsDetailTitle'>Req Recon:</td><td class='pcassistresultsDetailData'>" + data[i].ReqRecon + "</td><td class='pcassistresultsDetailTitle'>Input By:</td><td class='pcassistresultsDetailData'>" + data[i].InputBy + "</td></tr>";
rowEntry = rowEntry + "<tr class='" + rowClass + "'><td class='pcassistresultsDetailTitle'>From Site</td><td class='pcassistresultsDetailData'>" + data[i].FromSite + "</td><td class='pcassistresultsDetailTitle'>Input By Phone:</td><td class='pcassistresultsDetailData'>" + data[i].InputByPhone
rowEntry = rowEntry + "<tr class='" + rowClass + "'><td class='pcassistresultsDetailTitle' valign='top'>Comment:</td><td colspan='3' rowspan='2' title='" + strComment + "' ><div style='overflow:hidden; height:30px;'>" + data[i].Comment + "</div></td></tr>";
rowEntry = rowEntry + "<tr class='" + rowClass + "'><td> </td></tr>";
//Fix for Bug 71 ends
$('#unDecAddTable tbody>tr:last').after(rowEntry);
rowClass = rowClass == 'odd' ? 'even' : 'odd';
}
$('#unDeclaredAdditions *').tooltip();
});
});
尝试 2 与上面相同,但删除了 .tooltip() 部分,并在 document.ready 函数之外添加了以下代码
function PinTooltips() {
$('#unDeclaredAdditions *').tooltip();
$('#declaredAdditions *').tooltip();
}
$('#declaredAdditions').ajaxComplete(function(event, request, settings) {
PinTooltips();
});
有没有人看到我哪里出错了或者知道 IE6 有什么不寻常的地方会阻止它工作?