[jQuery] Ajax replaceWith problem...
Hello, I am trying to build an accordion that uses ajax to fetch it's
content.. I got everthing working and have the ajax receiving the data
successfully. However, when I go to make it replace the current
content, it does nothing. My xHTML looks like:
<a id="all">Title</a>
<div>
<ul>
<li>Loading...</li>
</ul>
</div>
I want the ajax results ti replace "<li>Loading...</li>
Here is what I attempted...
$.ajax({
url: "../cats.php?get="+this.id,
cache: false,
dataType: "script",
success: function(html){
$(this).next("div").children("ul").replaceWith(html);
},
error: function(){
alert("Error: File Not Found Or Connection Timed Out");
}
});
Thanks for the help,
- Devon