簡體   English   中英

在IE和firefox中運行$ .ajax的問題

[英]Issue with running $.ajax in IE and firefox

大家好,我正在使用chrome,並使用JQuery UI開發了一個窗口打開器,它的工作原理非常完美。 在IE和Firefox中,我注意到它無法正常工作,我在IE中進行了調試,並說

 `SCRIPT1028: Expected identifier, string or number`

function sendUserfNotes()
    {

        $.ajax({
        type: "POST",
        dataType: "json",
        url: '/pcg/popups/getNotes.php',
        data:
        {
            'nameNotes': notes_name.text(),

        },<!-- gave me the error right here?

        success: function(response) {
            $('#notes_msg').text(response.the_notes);
        }
    });

不知道為什么,但是這是我的腳本:

$(document).ready(function () { // this right here will wait to see if the 'access notes is clicked, if so then it will get te value of username and send it to run()
    $(".NotesAccessor").click(function () {
        notes_name = $(this).parent().parent().find(".user_table");

      run();
    });

    });
function run(){ // defines the place to get the notes, goes to showURL...() to open the JQuery dialog and than senduse....() to display them in the dialog.  
    var url = '/pcg/popups/grabnotes.php';

    showUrlInDialog(url);
    sendUserfNotes();


}
    function showUrlInDialog(url)
    {
      var tag = $("#dialog-container");
      $.ajax({
        url: url,
        success: function(data) {
          tag.html(data).dialog
          ({
              width: '100%',
                modal: true
          }).dialog('open');
        }
      });
    }
    function sendUserfNotes()
    {

        $.ajax({
        type: "POST",
        dataType: "json",
        url: '/pcg/popups/getNotes.php',
        data:
        {
            'nameNotes': notes_name.text(),

        },
        success: function(response) {
            $('#notes_msg').text(response.the_notes);
        }
    });

    }
    function getNewnotes(){
        new_notes = $('#notes_msg').val();
        update(new_notes);  
    }
    // if user updates notes
    function update(new_notes)
    {

            $.ajax({
        type: "POST",
        //dataType: "json",
        url: '/pcg/popups/updateNotes.php',
        data:
        {
            'nameNotes': notes_name.text(),
            'newNotes': new_notes,  
        },
        success: function(response) {
            alert("Notes Updated.");
            var i;
             $("#dialog-container").effect( 'fade', 500 );

            i = setInterval(function(){
             $("#dialog-container").dialog( 'close' );
            clearInterval(i);
            }, 500);

            }
    });

    }
    /******is user closes notes ******/
    function closeNotes()
    {
        var i;
         $("#dialog-container").effect( 'fade', 500 );

        i = setInterval(function(){
         $("#dialog-container").dialog( 'close' );
        clearInterval(i);
        }, 500);

    }

如果您能幫幫我,我將不勝感激:)不知道怎么了,為什么它只能在Chrome中運行? 你有任何需要都請告訴我。

大衛

data: { 'nameNotes': notes_name.text(), },

這是一個奇怪的問題,但是在text()之后刪除逗號。 那應該有幫助。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM