M
M
Mirgosso2018-07-05 08:06:29
JavaScript
Mirgosso, 2018-07-05 08:06:29

Inserting img, js, etc. in .HTML on an android smartphone?

There is Xiaomi Redmi 4a and *.html.
The problem arises when you try to insert into *.html sending to an image, a file with js code, etc. (it doesn't matter if the file is stored in the smartphone's memory or if it's an insert via url).
Mobile chrome simply does not see / does not show the inserted files.
Changing browser does not help.
Moreover, if you write the necessary js code inside * .html - everything is executed.
Everything is fine on PC too.
How can this problem be corrected?
Ps smartphone memory is used, flash drives are not available, android 7.1.2.
Pps This is how it works:
script>
var message;
message = "Hello!";
alert(message);
This is NOT how it works:
script src="/storage/emulated/0/Download/hello/script.js">
It doesn't work like this either:
script src="script.js"
As I already wrote on the PC, everything is fine.
But nothing works on the phone, even inserting an image from a link.
Could there be some kind of memory usage limit for android apps that can cause this kind of problem?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
A
Alexander Seryakov, 2018-07-05
@alexndb

Try using relative paths rather than absolute ones, ie. specify the path to the script.js file relative to the index.html file, for example, if they are in the same folder, then in index.html specify the link script src="script.js">

A
Andrey Pushkin, 2018-07-05
@a_pussycan

Describe your problem in more detail, while nothing is clear at all how and what should work

V
Vadim Popov, 2018-07-16
@vadimpopov94

Try
or
But most likely the first option will work

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question