开发者

How to Pass paramenter to javascript in webview

开发者 https://www.devze.com 2023-02-10 04:36 出处:网络
I have to pass argument to java开发者_运维问答script function from Webview, but it is calling properly.

I have to pass argument to java开发者_运维问答script function from Webview, but it is calling properly.

Thanks Vadivelu


Well ! I am just going to give an example. I know its too late ( almost a year :P )

 [self.myWebView stringByEvaluatingJavaScriptFromString:[NSString stringWithFormat: @"window.scrollTo(0,%i);",kPageSize*(self.currentPage-1)]];

You can notice that, I have passed a parameter to javascript from objective-c.

This will cause webView to scroll some-where within a webView.

Hope it helps.

Note : Please do not forget to accept answer if it is helpful to you. ( as I noticed most of your questions are not accepted. )

0

精彩评论

暂无评论...
验证码 换一张
取 消