calling plugin inside ajax call function problem

Posted by zurna on Stack Overflow See other posts from Stack Overflow or by zurna
Published on 2010-04-03T18:40:16Z Indexed on 2010/04/03 18:43 UTC
Read the original article Hit count: 195

Filed under:

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>

© Stack Overflow or respective owner

Related posts about jQuery