I need to be able to issue a load for an HTML document in a specific DIV when an event like menu-item click occurs. I tried the jQuery Load method in different ways, but nothing caused the HTML file to load at all, the result is either 404 or nothing happens. I have found several examples, but non worked for me, so I create my own example. I am aware the the loaded file must be in the same domain as the loading code (or so I understand), I thought maybe this is why the jsFiddle is not working, so I created a separate .HTML file and tried to load a local .HTML document but it also did not work.
HTML:
<div class="container">
<div class="row">
<div class="col">
<ul>
<li>
<a href="#" onclick='
$("#result").load(
"f\\doc1.html")
'>Click to load page in
RHS...</a>
</li>
<li><a href="">Doc1</a> </li>
<li><a href="" onclick="myLoader()"> Doc3</li>
<li id="ID11"><a href="">Doc4</a> </li>
</ul>
</div>
<div class="col">
<!----------------- TARGET div id=result------------>
<div id="result">
Load here...(result)
</div>
</div>
<div class="col">
<!----------------- TARGET div id=content------------>
<div id="content">
Load here...(content)
</div>
</div>
</div>
</div>
JS:
<script type="text/javascript">
$('#ID11').on('click', function () {
$('#content').load('f\doc1.html');
})
function myLoader() {
$('#content').load('f\doc1.html');
}
</script>
In summary, I need to cause a load of an HTML document into a DIV based on a menu item click outside the div that is target for the load.
I hope someone could point me to any method that works. Thanks.
Edit:
A stand-alone code file is here: Stand alone HTML Source
JQUERY reference must contain the load. the one to use is: https://code.jquery.com/jquery-3.3.1.min.js
The first link works in IE without disabling security.