在我的应用程序,我使用的WebView
在我使用 JavaScript的alert()
方法,但它不是工作,似乎没有弹出。
In my application I am using WebView
and in that I am using JavaScript alert( )
method but its not working, no pop-up appears.
在我的清单文件我已经加入
in my manifest file I have added
<uses-permission android:name="android.permission.INTERNET"></uses-permission>
在活动文件我已经加入
and in activity file I have added
mWebView = (WebView) findViewById(R.id.webview);
mWebView.getSettings().setJavaScriptEnabled(true);
mWebView.loadUrl("file:///android_asset/demo.html");
在布局的xml文件我已经加入
In layout xml file I have added
<WebView
android:id="@+id/webview"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
/>
任何线索如何启用全的JavaScript
在的WebView
?
更新
感谢马克
在警报()
在 HTML
文件的方法现在的工作:)。
Thanks mark
the alert()
method in the html
file are working now :) .
现在有在的WebView
两个问题:
1:我使用的是&LT; textarea的&GT;
在我加载在的WebView
,并试图将HTML文件写在印地文语言字体在里面,但是当我尝试写印地文文本其显示为符号(矩形符号像[])。
Now there are two issues in WebView
:
1: I am using a <textarea>
in the html file that i am loading in WebView
, and trying to write in Hindi language font in it, but when i try to write Hindi text it displays as symbols ( rectangle symbols like [] ) .
当我在Firefox浏览器一样在桌面上也能正常工作。
任何线索如何给予多语言支持的文本区域
在的WebView
?
when i do the same in firefox browser on desktop it works fine.
any clue how to give support for multiple language in textarea
in WebView
?
2:当我点击提交,并试图在打开文本的价值在另一个Java脚本这是行不通的警报()
的方法,它的意思是,即使使用后的 WebChromeClient
它仅适用于当前加载的HTML页面,而不是 JavaScript代码
所谓从该网页?
2: When I am clicking submit and trying to open the value of text in alert()
method in another java script it doesn't work , does it mean even after using WebChromeClient
its applicable only for current loaded html page and not javascripts
called from that page ?
请这链接,最后的评论,你必须使用WebChromeClient你的目的。
Check this link , and last comment , You have to use WebChromeClient for your purpose.