Tuesday, 6 August 2013

using jQuery .load and content will not load correctly

using jQuery .load and content will not load correctly

On my website, I'm looking to have a list of links in the sidebar
(leftcol), and clicking on one of those links will load new content into
the "content" section (rightcol) from another HTML file on the server. I
don't want to have twenty different pages with almost the exactly same
content copied over and over. I have shown my code below and please note I
have a file called "AboutUsInfo.html" on the server that has and have used
the full path to that HTML file in .load. This is the first thing I'm
doing anything in jQuery, so please let me know what I'm missing!
<div id="leftcol">
<h1>
About Us
</h1>
<script type="text/javascript">
$('#omicronchapterlink').click(function(){
$('#rightcol').load('Z:\\NewSite\PagesContent\AboutUsInfo.html
#OmicronChapter');
});
</script>
<a href="#" id="omicronchapterlink">About Us</a>
</div>
<div id="rightcol"></div>

No comments:

Post a Comment