smobx
smobx

Reputation: 67

Js file loaded from server doesn't work, but loaded locally works

I have an Android webview app. I decided to move a js file online so that I can make changes that affect the app immediately without having to update the app. If I load the script locally, everything works well. If I load it from the server I placed it in, it doesn't.

Note: when I test the WebView app in my browser, everything works well. On iOS works well either. I only got problems on Android.

After a lot of searches, I figured out that internet permissions must be allowed in AndroidManifest file, and it is. Javascript should be enabled, and it is. I simply can't figure out what the problem is. I also tried playing aroung with the html tag and its attributes, but with no result.

Here is the script:

<script type="text/javascript" src="http://mywebsite.com/content_controller/list.js"></script>

UPDATE: even an file loaded from external server doesn't work, while loading it locally works.

Upvotes: 0

Views: 361

Answers (1)

cs641311
cs641311

Reputation: 100

I don't know exactly what is going on, but you might want to do the following.

1.) Did you forget to make http:// to https:// 2.) add async to your script 3.) click on your link. Is the link correct. I can't go on it.

Upvotes: 1

Related Questions