Jump to content

get _IECreateEmbedded to work with html page loading js library


Recommended Posts

I cannot get any of my localhost pages that use Angular, jQuery, ExtJS etc to load into the embedded. All work perfectly with _IECreate of course. I started with

$oNav = _IENavigate($oIE, @ScriptDir & '/angularjs-hello-world.html', 0)

but that gave me nothing but _IE error messages with long integers - so went simpler(?) to my local server with

$oNav = _IENavigate($oIE, 'http://localhost:8080/Angular/angularjs-hello-world.html')

which opens the embedded page

<!-- saved from url=(0016)http://127.0.0.1 -->
<!DOCTYPE html>
<html>

<head>
    <script src="js/libs/angular.min.js"></script>
</head>

<body ng-app>
  <input type="text"
         ng-model="name"
         placeholder="Enter your name">
  <h1>Hello <span ng-bind="name"></span></h1>

</body>

</html>

but with no Angular ... the html objects are there e.g the input field but the Angular "Enter your name" is not there .... I do not think the js library is loading.

#include <GUIConstantsEx.au3>
#include <IE.au3>
#include <WindowsConstants.au3>

Local $oIE = _IECreateEmbedded()
GUICreate("Embedded Web control Test", 640, 580, _
        (@DesktopWidth - 640) / 2, (@DesktopHeight - 580) / 2, _
        $WS_OVERLAPPEDWINDOW + $WS_CLIPSIBLINGS + $WS_CLIPCHILDREN)
GUICtrlCreateObj($oIE, 10, 40, 600, 360)

Global $g_idError_Message = GUICtrlCreateLabel("", 100, 500, 500, 30)
GUICtrlSetColor(-1, 0xff0000)

GUISetState(@SW_SHOW) ;Show GUI

_IENavigate($oIE, 'http://localhost:8080/Angular/angularjs-hello-world.html')
CheckError("Init", @error, @extended)

; Waiting for user to close the window
While 1
    Local $iMsg = GUIGetMsg()
    Select
        Case $iMsg = $GUI_EVENT_CLOSE
            ExitLoop        
    EndSelect
WEnd

GUIDelete()

Exit

Func CheckError($sMsg, $iError, $iExtended)
    If $iError Then
        $sMsg = "Error using " & $sMsg & " button (" & $iExtended & ")"
    Else
        $sMsg = ""
    EndIf
    GUICtrlSetData($g_idError_Message, $sMsg)
EndFunc   ;==>CheckError

Works perfectly when run from localhost: and also when the html file is run from file system. The example for _IECreateEmbedded (which I shortened above) goes to www.autoit which loads jQuery so I know doable. First comment in html is meant to tweek IE security and I have been giving IE as much activeX settings as possible as I wonder if this is Win7/IE11 security?

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...