2013-03-13 61 views
0

爲什麼我得到這個錯誤:未捕獲的SyntaxError:意外的標記的jQuery

未捕獲的SyntaxError:意外的標記

錯誤在線25

$('form.ajax').on('submit', function() { 
    var that = $(this), 
     url = that.attr('action'), 
     type = that.attr('method'), 
     id = that.attr('id'), 
     data = {}; 

    that.find('[name]').each(function(index, value) { 
     var that = $(this), 
      name = that.attr('name'), 
      value = that.val(); 

     data[name] = value; 
    }); 

    $.ajax({  
     url: url, 
     type: type, 
     id: id, 
     data: data, 
     error: function(response){ 
     $(document).ready(function() { $("div").append("<div id='error'>Error</div>"); }); 
     }, 
     success: function(response) { 
      //Error on this line -> // $(".comContainer " + id + ).load(location.href+" .comContainer " + id + ">*",""); 
     } 
    }); 


    return false; 
}); 

是這裏出問題了嗎?我看不出它

下面是HTML代碼來獲取代碼:

<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js" type="text/javascript"></script> 
<script src="js/main.js" type="text/javascript"></script> 

回答

2

你有一個額外+

$(".comContainer " + id + ) 

應該

$(".comContainer " + id) 
+0

謝謝非常 :) – Thayer 2013-03-13 23:03:28

相關問題