將 Jquery.min 升級到 Jquery.1.9 時出錯 (Error Upgrade Jquery.min into Jquery.1.9)


問題描述

將 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 YantoShailesh Rathod)

參考文件

  1. Error Upgrade Jquery.min into Jquery.1.9 (CC BY‑SA 3.0/4.0)

#syntax-error #jquery #javascript #upgrade #html






相關問題

SQL Server 2008 - 嘗試編輯日期 - 語法錯誤? (SQL Server 2008 - Trying to edit dates - Syntax Error?)

將 Jquery.min 升級到 Jquery.1.9 時出錯 (Error Upgrade Jquery.min into Jquery.1.9)

SyntaxError:無效語法(打印功能) (SyntaxError: invalid syntax (print function))

錯誤:“if”之前的預期表達式 (error: expected expression before ‘if’)

導致 C2061 的用戶創建的標頭:語法錯誤:標識符“類名” (User-Created Header Causing C2061: Syntax Error : Identifier 'classname')

If 語句行收到語法錯誤 (Syntax Error received on If statement line)

語法錯誤:到達了意外的文件結尾。你有一個未關閉的#if (Syntax error: Unexpected end of file reached. You have an unclosed #if)

已經放 } 但錯誤仍然說 } 是預期的? (Already put } but the error still says that } is expected?)

為什麼 Java 不允許在這裡使用三元運算符? (Why doesn't Java allow the use of a ternary operator here?)

我在繪製向量時遇到語法錯誤 (I'm encountering a syntax error while plotting vectors)

我想在 Kotlin 中自定義新按鈕時遇到問題 (I have a problem when I want to customize my new button in Kotlin)

為什麼帶註釋的變量不能是全局的? (Why can't an annotated variable be global?)







留言討論