以下にリストされているのは私のjavascript関数です。この関数はIEでは正常に機能しますが、window.event部分が含まれているため、Firefoxでは実行されません。IE以外の他のブラウザーで機能するようにこれを行う方法は、関数ヘッダーのパラメーターリストでパラメーターe(またはその他の未定義のもの)を使用することです。すでに別のパラメーターがある場合、パラメーターにイベントを追加するにはどうすればよいですか?以下にリストされているのは、アプリケーションから関数への呼び出しの例です。再度、感謝します。
function entityclick(where) {
try {
var tempstring = new String(window.event.srcElement.id)
}
catch (oExp) {
var tempstring = new String("noclickyclicky")
}
tempstring = tempstring.substr(0, 3)
if (tempstring != "img") {
if (selectedentity != "") {
try {
document.getElementById('tbl' + selectedentity).style.backgroundColor = ""
}
catch (oExc) {
}
}
selectedentity = where.EntityID + where.EntityCat;
var EntityID = where.EntityID
var EntityCat = where.EntityCat
var ParentEntityID = where.ParentEntityID
var ParentEntityCat = where.ParentEntityCat
var projtype = 0
document.getElementById('tbl' + selectedentity).style.backgroundColor = "lightsteelblue"
//document.all('tbl'+selectedentity).className = "HighlightMe"
ifram = document.getElementById('detailframe')
if (0 == 0) {
if (EntityCat == 35)
ifram.src = "../teams/Viewteam.aspx?taskgrpid=" + EntityID + "&taskgrpcategory=" + EntityCat + "&ptaskgrpid=" + ParentEntityID + "&ptaskgrpcategory=" + ParentEntityCat + "&taskgrptype=" + GLOBALTASKGRPTYPE;
else if (EntityCat == 26)
ifram.src = "../teams/Viewteam.aspx?taskgrpid=" + EntityID + "&taskgrpcategory=" + EntityCat + "&ptaskgrpid=" + ParentEntityID + "&ptaskgrpcategory=" + ParentEntityCat + "&taskgrptype=" + GLOBALTASKGRPTYPE;
else if (EntityCat == 34)
ifram.src = "../teams/Viewteam.aspx?taskgrpid=" + EntityID + "&taskgrpcategory=" + EntityCat + "&ptaskgrpid=" + ParentEntityID + "&ptaskgrpcategory=" + ParentEntityCat + "&taskgrptype=" + GLOBALTASKGRPTYPE;
else if (EntityCat == 10)
ifram.src = "../solutions/ViewSolution.aspx?taskgrpid=" + EntityID + "&taskgrpcategory=" + EntityCat + "&ptaskgrpid=" + ParentEntityID + "&ptaskgrpcategory=" + ParentEntityCat + "&taskgrptype=" + GLOBALTASKGRPTYPE;
else if (EntityCat == 11)
ifram.src = "../observations/ViewObservation.aspx?taskgrpid=" + EntityID + "&taskgrpcategory=" + EntityCat + "&ptaskgrpid=" + ParentEntityID + "&ptaskgrpcategory=" + ParentEntityCat;
else if (EntityCat == 12)
ifram.src = "../actions/ViewAction.aspx?taskgrpid=" + EntityID + "&taskgrpcategory=" + EntityCat + "&ptaskgrpid=" + ParentEntityID + "&ptaskgrpcategory=" + ParentEntityCat;
else if (EntityCat == 13)
ifram.src = "../tasks/ViewTask.aspx?taskgrpid=" + EntityID + "&taskgrpcategory=" + EntityCat + "&ptaskgrpid=" + ParentEntityID + "&ptaskgrpcategory=" + ParentEntityCat;
ifram.style.left = '27%'
ifram.style.display = 'block'
//detail.style.display = 'none'
ifram.style.zIndex = 5
}
}
}
そして、これが関数の呼び出しです
entityclick(document.getElementById('tbl' + glbRefreshID + glbRefreshCAT))
編集:entityclickは、特定の場所で他の方法でも呼び出されます。
entityclick(this)
また
entityclick(document.getElementById('tbl' + GlobalExplodeID + GlobalExplodeCat))