I want to call a javascript command in the UIWebView page such as:
javascript:document.getElementById(\"MainContent_btnApprove\").click();
however I can't seem to get it to work. Here is what I have so far:
string url = "javascript:document.getElementById(\"MainContent_btnApprove\").click();";
WebView.ScalesPageToFit = true;
WebView.LoadRequest(new NSUrlRequest(new NSUrl(url)));
WebView.ScalesPageToFit = true;
But then I get a message saying:
System.Exception: Could not initialize an instance of the web 'Foundation.NSUrl': the native 'initWithString:' method returned nil.