0

I have to load a remote url in to my webview. It was taking too much time to load because of the size of script files included..

So i copied those js files in to my android "assets" folder tried to load them from the remote page like this..

<script type="text/javascript" src="file:///android_asset/myfile.js"></script>

the page loads, but the javascript is not working.. any solutions??

2 Answers 2

4

It is really hard to do what you want to do. You'll probably need to write some Java code in order to handle this. Check out this other SO answer.

Android: How to reference asset images from a remotely loaded html page in webview

Sign up to request clarification or add additional context in comments.

Comments

-1

If you forgot to enable Javascript for your WebView then set it by using:

 webview.getSettings().setJavaScriptEnabled(true);

And yes, post your full code that you are trying with.

1 Comment

No, javascript is enabled. I just found out that we cant load a local assset from a remote webpage.. thanks

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.