簡體   English   中英

為什么我的代碼無法在chrome中工作? 它適用於Internet Explorer

[英]Why doesn't my code work in chrome? It works in internet explorer

我是很久以前寫的。 我幾乎不懂html,這是一場噩夢,但確實奏效了。 這只是我簡化訪問仿真器的方法,但僅在Internet Explorer中有效。 它無法在Chrome中使用,但確實可以顯示。

 <!DOCTYPE html> <html> <body> <script type = "text/javascript" language = "javascript"> window.onload = function() { document.getElementById("NES").onmouseover = function() { this.style.backgroundColor = "#000000"; this.style.color = "#00FFFF"; } document.getElementById("NES").onmouseout = function() { this.style.backgroundColor = "#CCCCCC"; this.style.color = "#000000"; } document.getElementById("SNES").onmouseover = function() { this.style.backgroundColor = "#000000"; this.style.color = "#00FFFF"; } document.getElementById("SNES").onmouseout = function() { this.style.backgroundColor = "#CCCCCC"; this.style.color = "#000000"; } document.getElementById("Sega").onmouseover = function() { this.style.backgroundColor = "#000000"; this.style.color = "#00FFFF"; } document.getElementById("Sega").onmouseout = function() { this.style.backgroundColor = "#CCCCCC"; this.style.color = "#000000"; } document.getElementById("Gamecube").onmouseover = function() { this.style.backgroundColor = "#000000"; this.style.color = "#00FFFF"; } document.getElementById("Gamecube").onmouseout = function() { this.style.backgroundColor = "#CCCCCC"; this.style.color = "#000000"; } document.getElementById("GBC").onmouseover = function() { this.style.backgroundColor = "#000000"; this.style.color = "#00FFFF"; } document.getElementById("GBC").onmouseout = function() { this.style.backgroundColor = "#CCCCCC"; this.style.color = "#000000"; } document.getElementById("GBA").onmouseover = function() { this.style.backgroundColor = "#000000"; this.style.color = "#00FFFF"; } document.getElementById("GBA").onmouseout = function() { this.style.backgroundColor = "#CCCCCC"; this.style.color = "#000000"; } document.getElementById("N64").onmouseover = function() { this.style.backgroundColor = "#000000"; this.style.color = "#00FFFF"; } document.getElementById("N64").onmouseout = function() { this.style.backgroundColor = "#CCCCCC"; this.style.color = "#000000"; } document.getElementById("NDS").onmouseover = function() { this.style.backgroundColor = "#000000"; this.style.color = "#00FFFF"; } document.getElementById("NDS").onmouseout = function() { this.style.backgroundColor = "#CCCCCC"; this.style.color = "#000000"; } } </script> <script type = "text/javascript" language = "javascript"> function RunNES() { WshShell = new ActiveXObject("WScript.Shell"); WshShell.Run("file:///E:/Leisure/Games/Emulators/NES/NES%20System/nintendulator.exe", 1, false); } function RunSNES() { WshShell = new ActiveXObject("WScript.Shell"); WshShell.Run("file:///E:/Leisure/Games/Emulators/SNES/SNES%20System/zsnesw.exe", 1, false); } function RunSega() { WshShell = new ActiveXObject("WScript.Shell"); WshShell.Run("file:///E:/Leisure/Games/Emulators/Sega/Genesis/Fusion364/Fusion.exe", 1, false); } function RunGamecube() { WshShell = new ActiveXObject("WScript.Shell"); WshShell.Run("file:///E:/Leisure/Games/Emulators/Gamecube/Dolphin/Dolphin.exe", 1, false); } function RunGBC() { WshShell = new ActiveXObject("WScript.Shell"); WshShell.Run("file:///E:/Leisure/Games/Emulators/GBC/TGB-Dual.exe", 1, false); } function RunGBA() { WshShell = new ActiveXObject("WScript.Shell"); WshShell.Run("file:///E:/Leisure/Games/Emulators/GBA/GBALink.exe", 1, false); } function RunN64() { WshShell = new ActiveXObject("WScript.Shell"); WshShell.Run("file:///E:/Leisure/Games/Emulators/N64/Console/Project64.exe", 1, false); } function RunNDS() { WshShell = new ActiveXObject("WScript.Shell"); WshShell.Run("file:///E:/Leisure/Games/Emulators/DS/Desmume/DeSmuME_0.9.10_x64.exe", 1, false); } </script> <img style = "opacity:1; position:absolute; top:0px; left:0px; width:960px; height:540px; z-index: 0" src = "Images/Background.png"> <img style = "opacity:1; position:absolute; top:150px; left:50px; width:100px; height:100px; z-index: 1" src = "Images/NES.png"> <input style = "background-color:#CCCCCC; color:#000000; opacity:1; position:absolute; top:250px; left:50px; width:100px; height:20px; z-index: 1" id = "NES" type = "button" value = "Nintendo" onMouseover = "CursorIn()" onMouseout = "CursorOut()" onclick = "RunNES()" /> <img style = "opacity:1; position:absolute; top:150px; left:200px; width:100px; height:100px; z-index: 1" src = "Images/SNES.png"> <input style = "background-color:#CCCCCC; color:#000000; opacity:1; position:absolute; top:250px; left:200px; width:100px; height:20px; z-index: 1" id = "SNES" type = "button" value = "Super NES" onMouseover = "CursorIn()" onMouseout = "CursorOut()" onclick = "RunSNES()" /> <img style = "opacity:1; position:absolute; top:275px; left:50px; width:100px; height:100px; z-index: 1" src = "Images/Sega.png"> <input style = "background-color:#CCCCCC; color:#000000; opacity:1; position:absolute; top:375px; left:50px; width:100px; height:20px; z-index: 1" id = "Sega" type = "button" value = "Sega Genesis" onMouseover = "CursorIn()" onMouseout = "CursorOut()" onclick = "RunSega()" /> <img style = "opacity:1; position:absolute; top:275px; left:200px; width:100px; height:100px; z-index: 1" src = "Images/Gamecube.png"> <input style = "background-color:#CCCCCC; color:#000000; opacity:1; position:absolute; top:375px; left:200px; width:100px; height:20px; z-index: 1" id = "Gamecube" type = "button" value = "Gamecube" onMouseover = "CursorIn()" onMouseout = "CursorOut()" onclick = "RunGamecube()" /> <img style = "opacity:1; position:absolute; top:150px; left:660px; width:100px; height:100px; z-index: 1" src = "Images/GBC.png"> <input style = "background-color:#CCCCCC; color:#000000; opacity:1; position:absolute; top:250px; left:660px; width:100px; height:20px; z-index: 1" id = "GBC" type = "button" value = "Gameboy Clr" onMouseover = "CursorIn()" onMouseout = "CursorOut()" onclick = "RunGBC()" /> <img style = "opacity:1; position:absolute; top:150px; left:810px; width:100px; height:100px; z-index: 1" src = "Images/GBA.png"> <input style = "background-color:#CCCCCC; color:#000000; opacity:1; position:absolute; top:250px; left:810px; width:100px; height:20px; z-index: 1" id = "GBA" type = "button" value = "Gameboy Adv" onMouseover = "CursorIn()" onMouseout = "CursorOut()" onclick = "RunGBA()" /> <img style = "opacity:1; position:absolute; top:275px; left:660px; width:100px; height:100px; z-index: 1" src = "Images/N64.png"> <input style = "background-color:#CCCCCC; color:#000000; opacity:1; position:absolute; top:375px; left:660px; width:100px; height:20px; z-index: 1" id = "N64" type = "button" value = "Nintendo 64" onMouseover = "CursorIn()" onMouseout = "CursorOut()" onclick = "RunN64()" /> <img style = "opacity:1; position:absolute; top:275px; left:810px; width:100px; height:100px; z-index: 1" src = "Images/NDS.png"> <input style = "background-color:#CCCCCC; color:#000000; opacity:1; position:absolute; top:375px; left:810px; width:100px; height:20px; z-index: 1" id = "NDS" type = "button" value = "Nintendo DS" onMouseover = "CursorIn()" onMouseout = "CursorOut()" onclick = "RunNDS()" /> </body> </html> 

您正在使用ActiveX對象。 這些不是JavaScript,它們僅在Internet Explorer上可用。 無法在任何其他瀏覽器上執行使用ActiveX控件的代碼。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM