Javascript works on Desktop but does not work on Android

Asked

Viewed 1,042 times

0

I have a page in ASP.NET and on this screen has a Javascript function to only allow the typing of numbers in some fields.

When I run on the Desktop (any browser) this function works correctly, but when I open this page in the Android browser the screen allows you to type letters where you could not because you have the Javascript function that should prevent this.

That is, the JS function does not work in Android browsers (Default browser and Chrome). Note: Javascript is active in both browsers.

Follow a part of the page code.. inserir a descrição da imagem aqui

If you need more information I will provide.... I appreciate the help. Eduardo

1 answer

1

Fala Eduardo,

It would be good for you to post the code you are using in Java.

But you’re probably using a webView, right? Make sure that after the webView statement, you’re putting this:

webView.getSettings().setJavaScriptEnabled(true);

Hugs.

  • Hello Leonardo... the Java code is in the image attached to my question. this screen is an ASP.NET page on my server that I access through a browser like Chrome for example. what would be a "webView" ...?

  • I thought you were embedding this page inside your Android app, for that you would need a webView, where you would upload the page inside. In this case, Chrome itself enables Javascript, goes on Chrome Menu > Settings > Site Settings > Javascript (must be allowed)

  • I had already checked this permission and it is as "Allow Javascript"...

Browser other questions tagged

You are not signed in. Login or sign up in order to post.