I am not just a newbie with Javascript. I am developing a simple website to access web programming. The website is simple and the structure is as follows:
- Simple ul / li / css based navigation menu
- Subpages are loaded into a "div" using jQuery when the user clicks the corresponding menu item.
- Some of the subpages use different jQuery-based plugins, such as LightWindow, jTip, etc.
The jQuery function loading the subpage looks like this:
function loadContent(htmlfile){
jQuery("#content").load(htmlfile);
};
Menu items trigger the loadContent method as follows:
<li><a href="javascript:void(0)" onclick="loadContent('overview.html');return false">overview</a></li>
This loads the subpage name "overview.html" inside the "div".
What is it.
, , jQuery, "div" . , .
, :
jQuery, "index.html"
loadContent.
<script type="text/javascript" src="js/jquery-1.4.2.min.js"></script>
?
jQuery, ? "index.html" , ?
, script index.html, , . ?
:
screenshot.html. , , jQuery load() "index.html"
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html lang="en-US" xml:lang="en-US" xmlns="http://www.w3.org/1999/xhtml">
<head>
<script type='text/javascript' src='js/prototype.js'></script>
<script type='text/javascript' src='js/scriptaculous/scriptaculous.js'></script>
<script type='text/javascript' src='js/lightview.js'></script>
<link rel="stylesheet" type="text/css" href="css/lightview.css" />
</head>
<body>
<h3 style="text-align:left;">Screenshots</h3>
<div align="center">
<a class="lightview" href="images/ss_win1.png" title="Title"><img src="images/ss_win1_thumb.png" alt="" class="whiteborder"/></a>
<a class="lightview" href="images/ss_win2.png" title="Title"><img src="images/ss_win2_thumb.png" alt="" class="whiteborder"/></a>
<a class="lightview" href="images/ss_win3.png" title="Title"><img src="images/ss_win3_thumb.png" alt="" class="whiteborder"/></a>
</div>
</body>
</html>