HTML not working when opened from file, works from ftp server

K.Ward

I am trying to write html and css for a web page, but it doesn't show anything when I open the file directly from the file. It works fine when I access it through my ftp server, even from the same pc and browser. I have tried searching google for solutions, but I wasn't able to find anything

Errors image

Working image

index.html:

<!DOCTYPE html>
<html>
<link rel="stylesheet" href="style.css">
<script src="https://www.w3schools.com/lib/w3data.js"></script>

<head lang="en">
<meta charset="utf-8">
<title>Employee Page</title>
</head>

<body>
<div id="header"></div>
<br><br>
<div id="content"></div>
<div id="footer"></div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.0/jquery.min.js"></script>
<script>
    $("#header").load("header.html");
    $("#content").load("startingContent.html");
    $("#footer").load("footer.html");
</script>
</body>
</html>

header.html

<header>
<nav id="menu">
    <img id="logo" src="Images/logo.png"  height="150" style="border: 5px solid black">
    <ul>
        <li> <a href="ftp://wtpa.ddns.net/Site/index.html">Home</a></li>
        <li> <a href="ftp://wtpa.ddns.net/Site/calendar.html">Calendar</a>
        </li>
        <li> <a href="ftp://wtpa.ddns.net/Site/contacts.html">Contacts</a>
        </li>

        <li class="dropdown">
            <a href="javascript:void(0)" class="dropbtn">File Server</a>
            <div class="dropdown-content">
                <a href="#">Documents</a>
                <a href="#">GameFiles</a>
                <a href="#">Videos</a>
            </div>
        </li>
    </ul>
</nav>

</header>

style.css

.menu {
width: 100%;
vertical-align:top;
height:25px;
float: top;
 }

ul {
list-style-type: none;
margin: 0;
padding: 0;
overflow: hidden;
background-color: #333;
}

li {
float: left;
font-size: 16px;
display:inline-block;
}

li a, .dropbtn {
display: inline-block;
color: white;
text-align: center;
padding: 14px 16px;
text-decoration: none;
}

li a:hover, .dropdown:hover .dropbtn {
background-color: red;
}

li.dropdown {
display: inline-block;
}

.dropdown-content {
display: none;
position: absolute;
background-color: #f9f9f9;
min-width: 160px;
box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
z-index: 1;
}

.dropdown-content a {
color: black;
padding: 12px 16px;
text-decoration: none;
display: block;
text-align: left;
}

.dropdown-content a:hover {background-color: #f1f1f1}

.dropdown:hover .dropdown-content {

display: block;
}

Any help is appreciated. Thanks!

Konstantinos Koletsas

First of all, it appears that your navigation is using absolute linking.

<li> <a href="ftp://wtpa.ddns.net/Site/index.html">Home</a></li>
<li> <a href="ftp://wtpa.ddns.net/Site/calendar.html">Calendar</a>
</li>
<li> <a href="ftp://wtpa.ddns.net/Site/contacts.html">Contacts</a>
</li>

Furthermore, you can bring up you console, see what parts of your website refuse to load at all and change the routing.

EDIT

You cannot load these resources clearly for security reasons. Running pages through file:// protocol have disabled a lot of features because security issues. You can always create a javascript server using Node.js and host it locally without installing apache or something similar.

https://nodejs.org/en/

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

FTP from server to server not working

From Dev

FTP from server to server not working

From Dev

How can I send a html file from the server to be opened in the client's browser?

From Dev

Show files from ftp server in html gallery

From Dev

Ajax upload a file from browser to FTP server

From Dev

Upload a file to an FTP server from a string or stream

From Dev

Download the latest file from an FTP server

From Dev

Retrieve modified DateTime of a file from an FTP Server

From Dev

Ajax upload a file from browser to FTP server

From Dev

Downloading txt file from ftp server

From Dev

Download/copy file from FTP server in Java

From Dev

Unzip csv file from Zip on ftp server

From Dev

File upload on FTP server not working

From Dev

Transfer file from ftp Server to another ftp server using spring integration ftp support

From Dev

Transfer file from ftp Server to another ftp server using spring integration ftp support

From Dev

Get the latest file from a remote server from an FTP in Unix

From Dev

Get the latest file from a remote server from an FTP in Unix

From Dev

Javascript not working but works fine when put breakpoints and click the file from chrome debugger tools

From Dev

Javascript not working but works fine when put breakpoints and click the file from chrome debugger tools

From Dev

Why jQuery is working when directly opened as file on firefox but not working in XAMPP server?

From Dev

How to invoke a plugin in vim when no file is opened from commandline?

From Dev

Onfileloaded event not called when file is opened from Drive

From Dev

Exported excel file from datagridview shows error when opened VB

From Dev

Rename file from outside when it's opened in Java

From Dev

Onfileloaded event not called when file is opened from Drive

From Dev

download file from server in html

From Dev

The Eternal File.Exist CLR C# not working when called from SQL Server but working in C#

From Dev

How to download a file from FTP server to Android device?

From Dev

Reading from FTP Server randomly returns a blank text file

Related Related

  1. 1

    FTP from server to server not working

  2. 2

    FTP from server to server not working

  3. 3

    How can I send a html file from the server to be opened in the client's browser?

  4. 4

    Show files from ftp server in html gallery

  5. 5

    Ajax upload a file from browser to FTP server

  6. 6

    Upload a file to an FTP server from a string or stream

  7. 7

    Download the latest file from an FTP server

  8. 8

    Retrieve modified DateTime of a file from an FTP Server

  9. 9

    Ajax upload a file from browser to FTP server

  10. 10

    Downloading txt file from ftp server

  11. 11

    Download/copy file from FTP server in Java

  12. 12

    Unzip csv file from Zip on ftp server

  13. 13

    File upload on FTP server not working

  14. 14

    Transfer file from ftp Server to another ftp server using spring integration ftp support

  15. 15

    Transfer file from ftp Server to another ftp server using spring integration ftp support

  16. 16

    Get the latest file from a remote server from an FTP in Unix

  17. 17

    Get the latest file from a remote server from an FTP in Unix

  18. 18

    Javascript not working but works fine when put breakpoints and click the file from chrome debugger tools

  19. 19

    Javascript not working but works fine when put breakpoints and click the file from chrome debugger tools

  20. 20

    Why jQuery is working when directly opened as file on firefox but not working in XAMPP server?

  21. 21

    How to invoke a plugin in vim when no file is opened from commandline?

  22. 22

    Onfileloaded event not called when file is opened from Drive

  23. 23

    Exported excel file from datagridview shows error when opened VB

  24. 24

    Rename file from outside when it's opened in Java

  25. 25

    Onfileloaded event not called when file is opened from Drive

  26. 26

    download file from server in html

  27. 27

    The Eternal File.Exist CLR C# not working when called from SQL Server but working in C#

  28. 28

    How to download a file from FTP server to Android device?

  29. 29

    Reading from FTP Server randomly returns a blank text file

HotTag

Archive