HTMLViewRun() with Javascript Function

BlitzMax Forums/MaxGUI Module/HTMLViewRun() with Javascript Function

SebHoll(Posted 2006) [#1]
Hi,

I need to call a Javascript function in a webpage I have loaded in a HTMLView gadget, but whenever I try to run the function using:

HtmlViewRun( gadWebGadget, "addQuestion('This is a question', 'This is an answer');")
However, I get an error message saying that an object is expected :S. If I call an in-built javascript command it works, i.e.

HtmlViewRun(gadWebGadget,"alert('Hello!');")
But I can't get it to run a function defined in the web page.

Anyone any ideas? Thanks


Seb


SebHoll(Posted 2006) [#2]
Oops - I forgot I need to allow the page to load before calling the functions, so a simple procedure to wait for EVENT_GADGETDONE solved the problem.

Thanks anyway...