2010-04-03 51 views
1

我從另一個頁面的類別與ajax調用。問題是,從另一個頁面獲取的數據需要成爲另一個事件的一部分;標籤插件。綁定插件ajax調用

我收到以下錯誤代碼。

$.ajax({ 
     dataType: "xml", 
     success: function(xml) { 
      $(xml).find('row').each(function(){ 
       var id = $(this).attr('id'); 
       var CategoryName = $(this).find('CategoryName'); 
      }); 
     } 
    }).live('click', function() { 
       $("div.row-title").tabs("div.redpanes > div"); 
    }); 

回答

1

CategoryName是一個字符串,而不是一個jQuery對象。

var CategoryName = $(this).find('CategoryName').text(); 

找不到工作!

你可能在尋找:

 $(xml).find('row').each(function(){ 
      var id = $(this).attr('id'); 
      var CategoryName = $(this).find('CategoryName'); 
      $("<div class='tab fleft'><a href='http://www.refinethetaste.com/FLPM/content/home/index.cs.asp?Process=ViewVideos&CATEGORYID="+ id +"'>"+ CategoryName.text() + "</a></div>").appendTo("#VCategories"); 
     CategoryName.find("div.row-title .red").tabs("div.panes > div"); 

     }); 
+0

我如何讓它工作呢? – zurna 2010-04-03 18:52:21

+0

Urrr ...閱讀我的代碼片段? – Matt 2010-04-03 18:55:43

1

CategoryName是一個字符串,而不是一個DOM元素。您無法在其上運行find()