AU3强制本机内嵌IE版本为本机最高版本IE
默认内置IE对该js不兼容,以下代码强制内嵌IE版本为本机最高版本IE (测试本地打开IE9以下都不兼容该js),当然客户端IE最高版本要10或11才行。
au3内嵌IE出现js错误,一般都是因为不兼容造成的。但是在IE浏览器打开,某个元素不兼容会console出来,而在au3上就弹窗提示js所在的错误行。
引用:http://www.autoitx.com/redirect.php?goto=findpost&ptid=55122&pid=677480&fromuid=7652192
```#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <ie.au3>
#include <process.au3>
Local $regValue = "1"
RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_BROWSER_EMULATION", _ProcessGetName(@AutoItPID), "REG_DWORD", $regValue)
RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Internet Explorer\MAIN\FeatureControl\FEATURE_BROWSER_EMULATION", _ProcessGetName(@AutoItPID), "REG_DWORD", $regValue)
RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\Wow64\32Node\Microsoft\Internet Explorer\MAIN\FeatureControl\FEATURE_BROWSER_EMULATION", _ProcessGetName(@AutoItPID), "REG_DWORD", $regValue)
$oIE = ObjCreate("Shell.Explorer.1")
#Region ### START Koda GUI section ### Form=
$GUIMain = GUICreate("GUIMain", 800, 600, 0, 0)
GUICtrlCreateObj($oIE, 0, -0, 800, 600)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
$URL = "http://d3.decembercafe.org/demo/rm/lesson8/Chart.html"
$oIE.Navigate($URL)
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
EndSwitch
WEnd
```
发表评论
木有头像就木JJ啦!还木有头像吗?点这里申请属于你的个性Gravatar头像吧!