0

I want to InvokeMember("Click") in awesomium

i can do this when i have elementid or elementtag with somthing like this ;

JSObject document = webView.ExecuteJavascriptWithResult( "document" );

if ( document == null )
    return;

using ( document )
{
    JSObject signin = document.Invoke( "getElementById", "signin" );

    if ( signin == null )
        return;

    using ( signin )
        signin.InvokeAsync( "click" );
}

but i want to that when i have not any element , i need only Invoke "Click" in webpage for running java script code which opening pop up page with mouse click....

have any solution ?

Chris Schiffhauer
  • 17,102
  • 15
  • 79
  • 88
Sam
  • 175
  • 3
  • 17

1 Answers1

1

Use jQuery:

webView.ExecuteJavascript(@"$('#signin').trigger('click');");
Steve Jansen
  • 9,398
  • 2
  • 29
  • 34
  • i don't test this code , but i want to know , what is #signin it's element no ? or we create this element and then click ? what happen ? – Sam Feb 10 '14 at 20:23
  • `#signin` is the selector syntax for an element with an id of "signing". It is similar to your call to `document.getElementById('signin')` – Steve Jansen Feb 11 '14 at 01:19
  • So it's not good for me ! bcs i have not any element id or Tag and i don't need to click on special element i want only click like when we click on empty page....Now do you know what can i do ? (thnx, Kind regards) – Sam Feb 11 '14 at 09:59
  • 1
    I guess `webView.ExecuteJavascript(@"$(document.body).trigger('click');");` is what you need. This seems pointless though. – Steve Jansen Feb 11 '14 at 10:16