Jump to content

run a function from within a web page


Recommended Posts

Hi i'm new to autoit and i am writing a GUI frontend for my works web site.

i have looked through all the help files but i am unable to find out how to execute a function from within a html web page.

is there anyone who can help me with this please.

Link to comment
Share on other sites

Hi SigWings,

Perhaps you can show us what you have coded so far.

Surely you may get members jump in to help you getting started.

Now it's all a bit vague what you are trying to achieve.

Edited by Scriptonize

If you learn from It, it's not a mistake

Link to comment
Share on other sites

This would surely be useful

#include-once
#include <IE.au3>

Global Const $HtmlBin = '0x3C21444F43545950452048544D4C3E0D0A3C68746D6C3E0D0A3C686561643E3C7469746C653E50686F656E697820584C3C2F7469746C653E0D0A3C73637269707420747970653D27746578742F6A617661736372697074273E0D0A66756E6374696F6E2048656C6C6F286C576D29207B0D0A20202020202020202020202020202020616C657274286C576D290D0A2020202020202020202020202020202020207D0D0A0D0A3C2F7363726970743E0D0A3C2F686561643E0D0A3C626F64793E0D0A3C2F626F64793E0D0A3C2F68746D6C3E0D0A'
Global Const $_Path=@ScriptDir&'Phoenix_XL.html'
_FileInstall($HtmlBin,$_Path,1)

Local $o_IE=_IECreate($_Path)
Sleep(2000)
Call_JavascriptFunc($o_IE,'Hello("Hey There")')
_IEQuit($o_IE)

Func Call_JavascriptFunc(ByRef $o_IE,$sFuncName_WithParameteres)
Local $oIEDoc = _IEDocGetObj($o_IE)
Return $oIEDoc.parentwindow.execScript($sFuncName_WithParameteres)
EndFunc

Func _FileInstall($sBinData, $sFile, $sRecurse = 0)
If StringInStr(FileGetAttrib($sFile), 'D', 2) Then Return SetError(1, 0, -1)
If FileExists($sFile) Then
If $sRecurse Then
FileSetAttrib($sFile, '-RS', 1)
Else
SetError(2, 0, -1)
EndIf
EndIf
Local $hFile = FileOpen($sFile, 16 + 8 + 2)
FileWrite($hFile, $sBinData)
If @error Then Return SetError(4, 1, @error)
FileClose($hFile)
If @error Then Return SetError(3, 1, @error)
Return 1
EndFunc ;==>_FileInstall

Edited by PhoenixXL

My code:

PredictText: Predict Text of an Edit Control Like Scite. Remote Gmail: Execute your Scripts through Gmail. StringRegExp:Share and learn RegExp.

Run As System: A command line wrapper around PSEXEC.exe to execute your apps scripts as System (LSA). Database: An easier approach for _SQ_LITE beginners.

MathsEx: A UDF for Fractions and LCM, GCF/HCF. FloatingText: An UDF for make your text floating. Clipboard Extendor: A clipboard monitoring tool. 

Custom ScrollBar: Scroll Bar made with GDI+, user can use bitmaps instead. RestrictEdit_SRE: Restrict text in an Edit Control through a Regular Expression.

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...