ios - Call Javascript Function with multi-line string from UIWebView -
i using d3.js create chart information in form of tsv file. have tsv file saved nsstring. in javascript have function take string, parse it, , create chart based on contents. here code calling js function:
[self.mainwebview stringbyevaluatingjavascriptfromstring:[nsstring stringwithformat:@"parsetsv(\"%@\");", tsvstring]]; the function never called in above code, if pass in random string literal this:
[self.mainwebview stringbyevaluatingjavascriptfromstring:@"parsetsv(\"randomstring\")"]; is possibly because js doesn't take string multiple lines function argument? there workaround this?
thanks.
Comments
Post a Comment