How to Call a Javascript Function

This forum is for questions / discussions regarding development of addons / tweaks for MediaMonkey.

Moderator: Gurus

CarlitoGil
Posts: 294
Joined: Sun Sep 07, 2008 10:46 am
Location: Dominican Republic
Contact:

How to Call a Javascript Function

Post by CarlitoGil » Sat Oct 31, 2009 1:21 pm

I have a script that creates a dialog with an ActiveX browser
WB.Interf.document.body.tagName
returns 'BODY'
so WB.Interf is good and ready
WB.Infert gives access to window, so WB.interf.alert should work like window.alert, it doesn't

How do I call my JScript functions?
iTunesMonkey + Acoustid – Find metadata from iTunes and Acoustid

trixmoto
Posts: 10024
Joined: Fri Aug 26, 2005 3:28 am
Location: Hull, UK
Contact:

Re: How to Call a Javascript Function

Post by trixmoto » Sat Oct 31, 2009 1:58 pm

I think the way that my "Monkey Rok" script does this is by attaching the event to a hidden button like this...

Code: Select all

<input type="hidden" id="proxy" onclick="my_event()" />
...and then in my VBScript I do something like this...

Code: Select all

Dim obj : Set obj = WB.Interf.Document.getElementById("proxy")
If Not (obj Is Nothing) Then
  obj.fireEvent("onClick")
End If
Download my scripts at my own MediaMonkey fansite.
All the code for my website and scripts is safely backed up immediately and for free using Dropbox.

CarlitoGil
Posts: 294
Joined: Sun Sep 07, 2008 10:46 am
Location: Dominican Republic
Contact:

Re: How to Call a Javascript Function

Post by CarlitoGil » Sat Oct 31, 2009 2:05 pm

Thanks
iTunesMonkey + Acoustid – Find metadata from iTunes and Acoustid

Post Reply