0

I don't know if that is possible but is it possible for i.e to embed a javascript call inside a webpage and have an app which contains an uiwebview run that javascript code?

i.e the webpage calls a dofoo function but the dofoo javascript code is actually inside the iOS app. I know you can run js code in ios7 inside the app but would that work?

1 Answer 1

1
  1. Add your javascript code to the web page.
  2. Load the webpage into a UIWebView (i.e. myWebView).
  3. Call the javascript function from the code:

    [myWebView stringByEvaluatingJavaScriptFromString:@"myJavascriptFunction()"];

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

2 Comments

Hi , thanks for the response. What I want is the webpage to call the Javascript code which is not sitting on the webpage.
If i've understand, you should put inside <head>...</head> the path to your javascript file <script src="path/yourScript.js"></script>.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.