Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Calling Javascript functions in browser control

262 views
Skip to first unread message

Mark Rhodes

unread,
Oct 2, 2009, 12:47:29 PM10/2/09
to
I have an ole browser control and I would like to be able to call
javascript functions contained in the HTML in the browser. I can call
a script called resetdata() using code like this:

ole_browser.object.document.Script.resetdata()
ole_browser.object.document.ParentWindow.resetdata()

But, if the name of the function contains upper case letters, for
example if it is resetData(), it doesn't work - for some reason even
if the power script reads:

ole_browser.object.document.Script.resetData()

it calls the javascript function as all lowercase.
Does anybody have an idea why this is or a way around it?

Also, I have seen reference to people calling javascript functions in
browser controls in other languages with code that looks something
like:
...document.InvokeScript("resetData()")
I can't get InvokeScript to work in PowerBuilder. Am I missing
something or does it not exist?

Any help is appreciated.
Thanks,
Mark

mauryfs

unread,
Oct 2, 2009, 2:26:52 PM10/2/09
to
Mark,

Try ole_browser.object.document.ParentWindow.ExecScript("resetData()")

Mark Rhodes

unread,
Oct 2, 2009, 4:32:04 PM10/2/09
to
On Oct 2, 2:26 pm, mauryfs <maur...@gmail.com> wrote:
> Mark,
>
> Try ole_browser.object.document.ParentWindow.ExecScript("resetData()")

Thanks!

0 new messages