Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/82.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Coldfusion jQuery在动态div中查找元素_Jquery_Coldfusion_Cfml - Fatal编程技术网

Coldfusion jQuery在动态div中查找元素

Coldfusion jQuery在动态div中查找元素,jquery,coldfusion,cfml,Jquery,Coldfusion,Cfml,我有一个动态创建的div,其中包含2个div <div style="background-color:##cccccc; font-weight:bold; padding:0px 2px 2px 2px;">Call List Notes</div> <div style="padding:2px 10px 5px 10px; "> <div id="clnoteformdivedit" style="display:none

我有一个动态创建的div,其中包含2个div

<div style="background-color:##cccccc; font-weight:bold; padding:0px 2px 2px 2px;">Call List Notes</div>
    <div style="padding:2px 10px 5px 10px; ">
        <div id="clnoteformdivedit" style="display:none;">
            <cfform name="clnotefrm" action="" method="post">
                <cfinput type="hidden" name="ClIndNoteIndivnum" value="#val(attributes.UsersID)#">
                <cftextarea name="indNote" cols="60" rows="4">#qCallListNotes.notes#</cftextarea>
            <br />
            <cfinput type="button" name="CallListNotesButton" class="NotesButton" value="Submit Changes" />
            </cfform>
        </div>
        <div id="clnoteformdivdisplay">
                #qCallListNotes.notes#<br />
        </div>
    </div>
这样做的初衷是只显示注释。如果用户单击note/text区域,则div被隐藏,并显示允许输入的div。当他们点击提交按钮时,数据被更新,编辑div被隐藏,显示div

$('##CallListNotesButton').on('click', function() {
    var thisuserid = $(this).parent().find('##ClIndNoteIndivnum').val();
    var thisindivnote = $(this).parent().find('##indNote').val();
        $.ajax({
            type: 'POST',
            url: "actUpdateClIndivNote.cfm",
            data: 'calllistID=' + <cfoutput>#val(attributes.callListId)#</cfoutput> + '&userid=' + thisuserid + '&IndivNote=' + thisindivnote,
            error: function(xhr, textStatus, errorThrown) {
                // show error
            alert(errorThrown);
            },
            success: function(response1, textStatus, jqXHR) {
                //alert('success');
            $(this).parent().find('##indNote').val(thisindivnote);
            $('##clnoteformdivedit').hide();
            $('##clnoteformdivdisplay').show();
        }
        });
    });
    $('##clnoteformdivdisplay').on('click', function() {
        $('##clnoteformdivdisplay').hide();
        $('##clnoteformdivedit').show();
    });

问题是在显示分区中显示更新的笔记。我找不到要显示新笔记的正确分区

首先,jquery Selector或ColdFusion中有两个s需要成对使用。只生成一个。不要在$内使用$this。它不是您认为的那样。在$.ajax之前传入变量声明元素,这就是问题所在。我试图找到与我所在的div相关的indNote的更新值。