0
  script =@"<HTML>\n"
    "<HEAD>\n"
    "<TITLE></TITLE>\n"
    "<script language=\"javascript\">\n"
    "function openQuote(){\n"
      "  quoteForm.submit();}\n"
    "</script>\n"
   "</HEAD>\n"
    "<BODY>\n"
    "<form name=\"quoteForm\" url=\"http://localHost/Pages/CaseManagement.aspx?Page=CaseActivity\">\n"
    //    <input type="text" id="caseID" value="CA0S491"/>
   " </form>\n"
   " <input type=\"button\" onClick=\"openQuote();\" value=\"Click Me\"/>\n"
    "</BODY>"
   " </HTML>\n";

    I need to inject javascript on native button click

1 Answer 1

1

[webView stringByEvaluatingJavaScriptFromString:script];

Sign up to request clarification or add additional context in comments.

4 Comments

i need to load this script on webview on button click loadRequest
Sorry, but do you want to do execute a Javascript on touch of a Native Button, or want to call a native Action by clicking an HTML Button?
I want to inject the javaScript into UIWebView On native button click and reload the url webView with script parameter's and url!
Do you want to inject javascript see above, e.g. [webView stringByEvaluatingJavaScriptFromString:@"openQuote();"]; if you want to load an URL use loadRequest.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.