Page 1 of 1
Add OnClick to a webgadget page?
Posted: Fri Mar 01, 2013 10:45 pm
by ricardo
Hello
I need to add onclick evento to the body of a webpage programatically, once its loaded in the webgadget.
Any ideas how to achieve this?
Thanks in advance
Re: Add OnClick to a webgadget?
Posted: Fri Mar 01, 2013 10:47 pm
by Edwin Knoppert
I am using specially formatted url's and simply cancel the navigation inside the program when i recognize that url.
This means the navigateto() event..
Re: Add OnClick to a webgadget page?
Posted: Fri Mar 01, 2013 10:47 pm
by ricardo
I already can add the funcion like this:
Code: Select all
ExecuteJavaScript(0,"eval","function getid() {ID = event.srcElement.id;alert(ID);}","")
But cant attach the onclick to the <body>
Re: Add OnClick to a webgadget?
Posted: Fri Mar 01, 2013 10:49 pm
by ricardo
Edwin Knoppert wrote:I am using specially formatted url's and simply cancel the navigation inside the program when i recognize that url.
This means the navigateto() event..
I want to add a <body onclick=getid()>
Re: Add OnClick to a webgadget page?
Posted: Sat Mar 02, 2013 9:50 pm
by Edwin Knoppert
Is it your html?
Then you could use your own javascript code..?
if not you'll need the html document 'api's' to insert code.
Don't know how that must be done in purebasic but once you can get access to the dom (document3 afaik) object you should be able to do that.
Seems like a capture no one wants though..