添加链接
link管理
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接
B4X is a set of simple and powerful cross platform RAD tools:
  • B4A (free) - Android development
  • B4J (free) - Desktop and Server development
  • B4i - iOS development
  • B4R (free) - Arduino, ESP8266 and ESP32 development
  • All developers, with any skill level, are welcome to join the B4X community .

    Android Question WebViewExtras1.JavaScriptEnabled not work

    Sub Activity_Create(FirstTime As Boolean) Activity.LoadLayout("111") ' WebView1.Initialize("") WebViewExtras1.Initialize(WebView1) ' WebViewExtras1 now has all the methods and properties of WebView1 plus it's additonal methods and properties ' so you can use WebView1 to get/set WebView properties/methods ' or use WebViewExtras1 to get/set WebView1 properties/methods with the additional properties/method of WebViewExtras Dim WebViewClient1 As DefaultWebViewClient WebViewClient1.Initialize("WebViewClient1") WebViewExtras1.JavaScriptEnabled=True WebViewExtras1.SetWebViewClient(WebViewClient1) WebViewExtras1.AddJavascriptInterface(WebViewClient1,"B4A") WebViewExtras1.CanGoback() WebViewExtras1.LoadUrl("https://192.168.0.106/MobileOffice/D2548BA4-E6FD-43A0-9423-F4AE0BC7B710/Phone/Auth/Authorize/" & pId.GetDeviceId) End Sub Sub WebViewGoBack_Request() WebViewExtras1.GoBackOrForward(-1) Log(9) End Sub
    <div class="left">
            <a href="javascript:;" onclick="goBack()" class="headerButton"> <!--goBack-->
                <ion-icon name="chevron-back-outline"></ion-icon>
    <script>
        function goBack() {
            B4A.CallSubPlus('WebViewGoBack_Request', true);
    </script>
    Sub WebViewGoBack_Request()    'you need this sub in B4A so the webpage can call this sub
        WebviewClient1.Back
    End Sub
    I provide Custom Hardware and Software Solutions to Help Automate a Business to Reduce Costs and Increase Productivity.
    If any of my posts were helpful, please consider a donation of any amount ... or clicking on the Solution Vote or the Like button would be appreciated too. :)
    This will narrow down if the problem is that the goBack is not being called, or if the B4A.CallSub is not working right, so then we will know were to focus our troubleshooting efforts.
    So, does the Alert pop-up display when you click the hyperlink using the above modification?
    I provide Custom Hardware and Software Solutions to Help Automate a Business to Reduce Costs and Increase Productivity.
    If any of my posts were helpful, please consider a donation of any amount ... or clicking on the Solution Vote or the Like button would be appreciated too. :)
    I provide Custom Hardware and Software Solutions to Help Automate a Business to Reduce Costs and Increase Productivity.
    If any of my posts were helpful, please consider a donation of any amount ... or clicking on the Solution Vote or the Like button would be appreciated too. :)
    I provide Custom Hardware and Software Solutions to Help Automate a Business to Reduce Costs and Increase Productivity.
    If any of my posts were helpful, please consider a donation of any amount ... or clicking on the Solution Vote or the Like button would be appreciated too. :)
    I provide Custom Hardware and Software Solutions to Help Automate a Business to Reduce Costs and Increase Productivity.
    If any of my posts were helpful, please consider a donation of any amount ... or clicking on the Solution Vote or the Like button would be appreciated too. :)
    I provide Custom Hardware and Software Solutions to Help Automate a Business to Reduce Costs and Increase Productivity.
    If any of my posts were helpful, please consider a donation of any amount ... or clicking on the Solution Vote or the Like button would be appreciated too. :)
    I provide Custom Hardware and Software Solutions to Help Automate a Business to Reduce Costs and Increase Productivity.
    If any of my posts were helpful, please consider a donation of any amount ... or clicking on the Solution Vote or the Like button would be appreciated too. :)
    Sub Activity_Create(FirstTime As Boolean) Activity.LoadLayout("111") ' WebView1.Initialize("") WebViewExtras1.Initialize(WebView1) ' WebViewExtras1 now has all the methods and properties of WebView1 plus it's additonal methods and properties ' so you can use WebView1 to get/set WebView properties/methods ' or use WebViewExtras1 to get/set WebView1 properties/methods with the additional properties/method of WebViewExtras Dim WebViewClient1 As DefaultWebViewClient WebViewClient1.Initialize("WebViewClient1") WebViewExtras1.JavaScriptEnabled=True WebViewExtras1.SetWebViewClient(WebViewClient1) 'This row is useless 'WebViewExtras1.AddJavascriptInterface(WebViewClient1,"B4A") Dim JavascriptInterface1 As DefaultJavascriptInterface JavascriptInterface1.Initialize WebViewExtras1.AddJavascriptInterface(JavascriptInterface1,"B4A") WebViewExtras1.CanGoback() WebViewExtras1.LoadUrl("https://192.168.0.106/MobileOffice/D2548BA4-E6FD-43A0-9423-F4AE0BC7B710/Phone/Auth/Authorize/" & pId.GetDeviceId) End Sub Sub WebViewGoBack_Request() WebViewExtras1.GoBackOrForward(-1) Log(9) End Sub This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies. Accept Learn more…