In an attempt to transfer an array from Xcode to a local HTML file, I am utilizing jQuery in the HTML code. This involves using loadHTMLString:
with baseURL
to read both the HTML and included .js files. However, I am encountering an issue when trying to use
stringByevaluatingjavascriptfromstring
to load the webview. The specific code snippet is as follows:
NSString *java=[NSString stringWithFormat:@"javafunction('%@');",json];
[webView loadHTMLString:content baseURL:baseURL];
[webView stringByEvaluatingJavaScriptFromString:java];
Within my HTML file, I have implemented the following function:
function javafunction(inp) {
var arr=newArray();
arr='inp';
alert(arr[0]);
}