Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Link in html page on android doesn't work

Tags:

html

android

I made two html pages on a desktop computer and transferred them to a mobile phone and put them in the same folder. The operating system on the mobile phone is android 8.1.0. When I open one of the pages, it opens in google chrome but the link to the other page doesn't work.

This is code for first page:

<!doctype HTML>
<html>
    <head>
        <meta charset="utf-8">
        <title>index1</title>
    </head>
    
    <body>

        <a href="index2.html">go to index2</a>
            
    </body>
            
</html>

This is code for second page:

<!doctype HTML>
<html>
    <head>
        <meta charset="utf-8">
        <title>index2</title>
    </head>
    
    <body>

        <a href="index1.html">go to index1</a>
            
    </body>
            
</html>

Works perfectly on a desktop computer but does not work on a mobile phone.

like image 678
slobodif Avatar asked Dec 18 '25 11:12

slobodif


2 Answers

Problem solved. In my phone, if you want links to work, than links to files do not end with the file name and extension but with the file number. I could read the file number when I opened that file with the google chrome app in the address/search bar. And I had to install some text editor and work directly on mobile. This is what the code for linking two html pages looked like in the end:

First page:

<!doctype HTML>
<html>
    <head>
        <meta charset="utf-8">
        <title>index1</title>
    </head>
    
    <body>

        <a href="content://0@media/external/file/7912">go to index2</a>
            
    </body>
            
</html>

Second page:

<!doctype HTML>
<html>
    <head>
        <meta charset="utf-8">
        <title>index2</title>
    </head>
    
    <body>

        <a href="content://0@media/external/file/7911">go to index1</a>
            
    </body>
            
</html>

Thanks a lot guys for the help, I appreciate every effort.

like image 153
slobodif Avatar answered Dec 20 '25 01:12

slobodif


I found a solution to this problem by just replace the URL in the browser with the form : file:///storage/emulated/0/folder1/folder2.../file.extention

like image 41
Mo Fayyad Avatar answered Dec 20 '25 03:12

Mo Fayyad



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!