accordion loading data fromn database not working

accordion loading data fromn database not working

I have an accordion and a sql database, below is my html
My problem is it does ALWAYS bring out data into the accordion when I click on the Link. Sometimes it can be two clicks.
Any ideas how to fix my problem?
<script>
$("accordion").accordion({
autoHeight:false, heightStyle: "content",cache:false
});
$("h2,"#accordion").click(function(e) {
var contentDiv = (this).next("div");
contentDiv.load($(this).find("a").attr("href");
});
</script>
<div id="accordion">
<h2 id="<%=lnkPid%>">
<a href="load.asp?pid=lnkPid"><%=strPerson%></a>
</h2>
</div>
<div id="<%=lnkPid%>"></div>