I getting the below error when trying to load some webpages
Error parsing a meta element's content: ';' is not a valid key-value pair separator. Please use ',' instead.
How do I solve it?
I getting the below error when trying to load some webpages
Error parsing a meta element's content: ';' is not a valid key-value pair separator. Please use ',' instead.
How do I solve it?
If you are using webview.loadUrl() method to load a web page make sure that elements in the content attribute in meta tag (of web page's html) should have its elements comma "," separated neither semi-colon ";" nor blank space, for example:
Like this:
<meta name="viewport" content="key1=value1,key2=value2,key3=value3"> //best practice
Not even this, though supported but not recommended:
<meta name="viewport" content="key1=value1;key2=value2;key3=value3">
Not even this, though supported but not recommended:
<meta name="viewport" content="key1=value1;key2=value2;key3=value3">
So, see meta tag in your html's head tag having name="viewport", it should have it elements (i.e. key=values) comma separated in its content attribute, so after fixing it should like this:
<head>
...
<meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1">
....
</head>
Ref: https://developer.mozilla.org/en-US/docs/Mozilla/Mobile/Viewport_meta_tag
Also see this similar thread: Android Webview - Scale image to fit screen properly with one loadUrl
I was able to solve this issue by implementing the below code:
webView_courseLesson.settings.javaScriptEnabled = true
webView_courseLesson.settings.loadWithOverviewMode = true
webView_courseLesson.settings.useWideViewPort = true
By default the javaScript support is turned off by the Android framework. Though you can check documentation here http://developer.android.com/guide/practices/security.html