Whilst I'm coding I'd like to be able to see the HTML I've created, for example, I have a index.html
which refers to a header navigation file.
Using jQuery
, I can get this to work on the server side but I want it to work locally as well but I heard current versions of browsers have security which prevents it from working with local files.
Does anyone know of a browser or a setting or an alternative that will allow the reuse of HTML linkages to work locally as well as on the server side?
The code below (obtained from this answer) only works on the server side.
<html>
<head>
<title></title>
<script src="https://code.jquery.com/jquery-3.3.1.js" integrity="sha256-2Kok7MbOyxpgUVvAk/HJ2jigOSYS2auK4Pfzbm7uH60=" crossorigin="anonymous"></script>
<script>
$(function(){
$("#header").load("header.html");
$("#footer").load("footer.html");
});
</script>
</head>
<body>
<div id="header"></div>
<!-- remaining section -->
<div id="footer"></div>
</body>
</html>
Surely there's a better way that'll allow me to see my <header />
and <footer />
elements without having to deploy to the server after every update.
Sometimes I just want to test changes in navigation without deploying.