Jump to content

Run javascript code


Recommended Posts

umm, dumb question, but why do you need for the javascript to fire? Couldn't you just make an autoitscript to do what the javascript does and have that run instead?

I would, but other then what I posted above, I don't know what else it does. Here is a basic run down of what I'm trying to do.

1. Launch Ie & Navigate To Page

2. Check if a element is enabled, if it is Run the javascript code I posted above.

3. run the rest of the code

Link to comment
Share on other sites

$sReturn = IEEval($oIE, "onForgetMe(0);")

Func IEEval($o_object, $s_eval)
    Return $o_object.document.parentwindow.eval($s_eval)
EndFunc   ;==>IEEval

Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl

MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model

Automate input type=file (Related)

Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded  Better Better?

IE.au3 issues with Vista - Workarounds

SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y

Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead?

Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble

Link to comment
Share on other sites

I tried the example

and script gets error "The requested action with object fails" and points to 'parentWindow'

му page has 4 frames

and one of them has link to java script .ajax.js

there is an array I need

Link to comment
Share on other sites

$oIE2 = _IEAttach ($HWnD2, "Embedded", 1)
$oDoc = _IEDocGetObj ($oIE2)
If IsObJ($oDoc) Then $sVal = IEEval($oDoc ,"java script:str_pr[2]")

$oIE2 = _IEAttach ($HWnD2, "Embedded", 1)
$oFrame = _IEFrameGetObjByName ($oIE2, "main_top")
$oDoc = _IEDocGetObj ($oFrame)
If IsObJ($oDoc) Then $sVal = IEEval($oDoc ,"java script:str_pr[2]")

both crashes

Can smb explain why?

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

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...