iOS - 如何使用带有javascript处理程序/接口的EasyJSWebView调用javascript函数

时间:2015-10-24 20:57:04

标签: javascript ios iphone uiwebview

使用 EasyJSWebView 以便在我的应用中与JS进行通信。

[self.BookReaderWeb addJavascriptInterfaces:roomHelper WithName:@"ReadingRoomHelper"];

使用此代码链接JSinterface。 现在我需要调用一个名为initiateAddBookmarkCall()

的方法
function initiateAddBookmarkCall(){
    var locus = reader.getPlace().getLocus();
    ReadingRoomHelper.postReaderLocus(JSON.stringify(locus));
}

这将是这样的!我需要获取locus的值并从以下地址获得返回:

ReadingRoomHelper.postReaderLocus(JSON.stringify(locus));

有人可以帮助我实现这个目标。

0 个答案:

没有答案