OiO.lk Community platform!

Oio.lk is an excellent forum for developers, providing a wide range of resources, discussions, and support for those in the developer community. Join oio.lk today to connect with like-minded professionals, share insights, and stay updated on the latest trends and technologies in the development field.
  You need to log in or register to access the solved answers to this problem.
  • You have reached the maximum number of guest views allowed
  • Please register below to remove this limitation

Nav bar slow to load using separate file

  • Thread starter Thread starter beepbeepboop
  • Start date Start date
B

beepbeepboop

Guest
I have my nav bar HTML in its own file. It's simple a href text with a 60KB image. I'm calling it with this at the bottom of my body:

Code:
  <script>
    $("#nav-placeholder").load("nav.html");
  </script>

I've looked at the Network console and the nav.html is executed well after a few other files.

I tried adding the nav.html code directly to the main index.html, and this latency is gone. I only have two pages, so I might hardcode it if I can't figure out why this latency is happening. I'm using php -S to run on a localhost. Any ideas? Thank you!

<p>I have my nav bar HTML in its own file. It's simple a href text with a 60KB image. I'm calling it with this at the bottom of my body:</p>
<pre><code> <script>
$("#nav-placeholder").load("nav.html");
</script>
</code></pre>
<p>I've looked at the Network console and the nav.html is executed well after a few other files.</p>
<p>I tried adding the nav.html code directly to the main index.html, and this latency is gone.
I only have two pages, so I might hardcode it if I can't figure out why this latency is happening. I'm using php -S to run on a localhost.
Any ideas? Thank you!</p>
 

Latest posts

G
Replies
0
Views
1
Gamal Othman
G
Top