Add OnClick to a webgadget page?

Just starting out? Need help? Post your questions and find answers here.
ricardo
Addict
Addict
Posts: 2438
Joined: Fri Apr 25, 2003 7:06 pm
Location: Argentina

Add OnClick to a webgadget page?

Post 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
Last edited by ricardo on Sat Mar 02, 2013 12:38 am, edited 1 time in total.
ARGENTINA WORLD CHAMPION
Edwin Knoppert
Addict
Addict
Posts: 1073
Joined: Fri Apr 25, 2003 11:13 pm
Location: Netherlands
Contact:

Re: Add OnClick to a webgadget?

Post 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..
Last edited by Edwin Knoppert on Fri Mar 01, 2013 10:47 pm, edited 1 time in total.
ricardo
Addict
Addict
Posts: 2438
Joined: Fri Apr 25, 2003 7:06 pm
Location: Argentina

Re: Add OnClick to a webgadget page?

Post 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>
ARGENTINA WORLD CHAMPION
ricardo
Addict
Addict
Posts: 2438
Joined: Fri Apr 25, 2003 7:06 pm
Location: Argentina

Re: Add OnClick to a webgadget?

Post 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()>
ARGENTINA WORLD CHAMPION
Edwin Knoppert
Addict
Addict
Posts: 1073
Joined: Fri Apr 25, 2003 11:13 pm
Location: Netherlands
Contact:

Re: Add OnClick to a webgadget page?

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