calling plugin inside ajax call function problem
- by zurna
I pull categories of one section from an XML. Problem is, pulled categories need to recognize tab plugin so I tried to add tab plugin to CategoryName variable. But it is not working. I get the following error.
Error: CategoryName.find is not a function
Source File: http://www.refinethetaste.com/FLPM/
Line: 23
Test website:
http://www.refinethetaste.com/FLPM/
$.ajax({
dataType: "xml",
url: "/FLPM/content/home/index.cs.asp?Process=ViewVCategories",
success: function(xml) {
$(xml).find('row').each(function(){
var id = $(this).attr('id');
var CategoryName = $(this).find('CategoryName').text();
$("<div class='tab fleft'><a href='http://www.refinethetaste.com/FLPM/content/home/index.cs.asp?Process=ViewVideos&CATEGORYID="+ id +"'>"+ CategoryName + "</a></div>").appendTo("#VCategories");
CategoryName.find("div.row-title .red").tabs("div.panes > div");
});
}
});
pulled categories displayed here:
<div class="row-title clear" id="VCategories">
categories xml
<rows>
-
<row id="1">
<CategoryName>Nation</CategoryName>
</row>
-
<row id="2">
<CategoryName>Politics</CategoryName>
</row>
-
<row id="3">
<CategoryName>Health</CategoryName>
</row>
-
<row id="4">
<CategoryName>Business</CategoryName>
</row>
-
<row id="5">
<CategoryName>Culture</CategoryName>
</row>
</rows>
</div>