I have a web page that loads a Javascript .js library. It works correctly with browsers on Windows (Firefox) or Android (Chrome). It's not loading in a WebView.
I've added Javascript alert statements in the Javascript in the HTML and in the .js libraries as a test.
I can see it's working on Windows and Android based on the Alerts being displayed.
But in the WebView only the Javascript alert in the HTML display, the one in the .js file doesn't.
The .js library is loaded into HTML in the usual way:
html
library.js
app
So, any ideas why the .js isn't loading?
I've added Javascript alert statements in the Javascript in the HTML and in the .js libraries as a test.
I can see it's working on Windows and Android based on the Alerts being displayed.
But in the WebView only the Javascript alert in the HTML display, the one in the .js file doesn't.
The .js library is loaded into HTML in the usual way:
html
B4X:
<script type="text/javascript">
alert("This displays");
</script>
<script type="text/javascript" src="library.js"></script>
library.js
B4X:
alert("This does NOT display");
app
B4X:
#Region Project Attributes
#ApplicationLabel: WebView Javascript
#VersionCode: 1
#VersionName:
'SupportedOrientations possible values: unspecified, landscape or portrait.
#SupportedOrientations: unspecified
#CanInstallToExternalStorage: False
#End Region
#Region Activity Attributes
#FullScreen: False
#IncludeTitle: True
#End Region
Sub Process_Globals
End Sub
Sub Globals
Dim libWebView As WebView
End Sub
Sub Activity_Create(FirstTime As Boolean)
libWebView.Initialize("libWebView")
Activity.AddView(libWebView, 0, 0, 100%X, 100%Y)
libWebView.LoadUrl("https://xxxxxxxxxxxx")
End Sub
Sub Activity_Resume
End Sub
Sub Activity_Pause (UserClosed As Boolean)
End Sub
So, any ideas why the .js isn't loading?