問題描述
將 Jquery.min 升級到 Jquery.1.9 時出錯 (Error Upgrade Jquery.min into Jquery.1.9)
I try this code in jqueri.min1.2.js Work but in Jquery.1.9.js not Work
$('a.comment').livequery("click", function(e){
var getpID = $(this).parent().attr('id').replace('commentBox‑','');
var comment_text = $("#commentMark‑"+getpID).val();
if(comment_text != "Write a comment...")
{
$.post("add_comment.php?comment_text="+comment_text+"&post_id="+getpID, {
}, function(data){
$('#CommentPosted'+getpID).append($(data).fadeIn('slow'));
$("#commentMark‑"+getpID).val("Write a comment...");
});
}
});
Ouput on console "Uncaught Error: Syntax error, unrecognized expression:" ON MY BROWSER NO RETURN FROM add_comment.php
Help me please... How to output is Html response from add_comment.php ... HOW TO OUTPUT html FROM add_comment.php
參考解法
方法 1:
I am not sure what your actual problem but I think that, will upgrading the jquery lib, after loading the updated jquery lib you need to add jquery migrate js, which will make the older lib functions work in newer one.
(by Muji Yanto、Shailesh Rathod)