Jump to content
Sign in to follow this  
cmnetworx

Execute js within internet explorer

Recommended Posts

cmnetworx

I am having a bit of a hard time wrapping my head around this one..

I am trying to execute javascript out of an already loaded page..

#include <IE.au3>
$oIE = _IEAttach ("http://localhost/list.php - Microsoft Internet Explorer")
$oIEDoc = _IEDocGetObj($oIE)
$oIEDoc.parentwindow.setTimeout('show_alert()', 0)

However this does not work, The error I am getting is Variable must be of type "Object"

What am I missing here..?

Is this failing to attach to the window? or can this not be done, and a new window must be loaded?

Any help would be appreciated, thanks.

Share this post


Link to post
Share on other sites
cmnetworx

Ok, So I got this to work when I changed it to

#include <IE.au3>
$v = _IEAttach ("AutoIt")
$v.document.parentwindow.execscript("alert('Hello')")

Share this post


Link to post
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
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.