taren9k3 Posted May 23, 2009 Share Posted May 23, 2009 (edited) <script>var a=1</script>I have this script.How to set a value to 123 by using autoit script.thanks Edited May 24, 2009 by taren9k3 Link to comment Share on other sites More sharing options...
Authenticity Posted May 23, 2009 Share Posted May 23, 2009 (edited) #include <IE.au3> Dim $oIE, $oScripts, $oScript $oIE = _IECreate('http://www.google.com/') ConsoleWrite('a variable is: ' & IEEval($oIE, 'a') & @LF) ;$oScript = $oIE.document.scripts(2) ;ConsoleWrite(_IEPropertyGet($oScript, 'innerhtml') & @LF) ;IEEval($oScript, 'a=123') IEEval($oIE, 'a=123') ConsoleWrite('a variable is: ' & IEEval($oIE, 'a') & @LF) ; Thanks DaleHohm for the code. Func IEEval($o_object, $s_eval) Return $o_object.document.parentwindow.eval($s_eval) EndFunc ;==>IEEval Edited May 23, 2009 by Authenticity Link to comment Share on other sites More sharing options...
taren9k3 Posted May 23, 2009 Author Share Posted May 23, 2009 How do you know document.parentwindow.eval($s_eval) Where can I find document.name.value,.... Can you tell me. Link to comment Share on other sites More sharing options...
taren9k3 Posted May 24, 2009 Author Share Posted May 24, 2009 Authenticity reply me! Link to comment Share on other sites More sharing options...
Authenticity Posted May 24, 2009 Share Posted May 24, 2009 Hi, heh sorry for not replying here. I didn't know about it, it's from another thread the DaleHohm posted. It's not documented here yet but I believe that the Window object exposes it as well as the execScript method which, if I understand it correctly, does the same as eval. Link to comment Share on other sites More sharing options...
taren9k3 Posted May 24, 2009 Author Share Posted May 24, 2009 Thank for replying ) Link to comment Share on other sites More sharing options...
Stilgar Posted May 24, 2009 Share Posted May 24, 2009 (edited) How do you know document.parentwindow.eval($s_eval)Where can I find document.name.value,....Can you tell me.That's only Java-Script:http://www.w3schools.com/jsref/jsref_eval.aspeval on the DOM-element document.parentwindow. Edited May 24, 2009 by Stilgar jEdit4AutoIt PlanMaker_UDF Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now