The problem is that you've declared your memberspage()
function inside a document ready handler, which means that it is not in scope when you try to call it from an inline onclick
handler on your anchor element - inline attributes like that can only access global functions.
You can fix this by moving the function declaration out of the document ready (making it global), but a better option would be to bind the click handler with jQuery:
$(document).ready(function() {
$("#menu1 a").click(function(e){
$('#contentarea').load('members.html #colTwo');
e.preventDefault();
});
});
I've added e.preventDefault()
to stop the default behaviour on the anchor click which might otherwise scroll back to the top of the page. (In an inline handler you would get the same effect by returning false.)
Note also that your <script>
element that includes jquery.js is missing a closing >
right before the closing </script>
.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…