StupidBeauty
Read times:542Posted at:Thu Dec 6 04:04:14 2012
- no title specified

转载 ExternalInterface.call

使用ExternalInterface.call时,可将 javascript 函数 和其中的参数写成一整个字符串来调用。这样就 可以实现调用那种 在运行时才能确定其参数个数的函数了 ,把字符串拼凑好即可

http://cunnyyun.blogspot.com/2010/10/externalinterfacecall.html

亮点

非標準寫法

ExternalInterface.call("sendToJavaScript('"+input.text+"')");

看出不同的地方了嗎???

沒錯!!就是改寫成直接帶入函式來使用

當然!要注意的是!引號的問題!!如果input.text裡有單引號的話!就會造成錯誤

可以用JSON.encode()去處理就行了

Your opinions
Your name:Email:Website url:Opinion content:
- no title specified

HxLauncher: Launch Android applications by voice commands

 
Recent comments
2017年4月~2019年4月垃圾短信排行榜Posted at:Thu Sep 26 04:51:48 2024
Qt5.7文档翻译:QWebEngineCookieStore类,QWebEngineCookieStore ClassPosted at:Fri Aug 11 06:50:35 2023盲盒kill -9 18289 Grebe.20230517.211749.552.mp4