1

div を更新しようとしていますが、div が重複してしまいます。もう一方の内側。現在、ビューに jQuery、Struts2、および Struts2 jQuery プラグインを使用しています。

現在行っていること:

<div id="nameVolumeWrapper....>
    <div id="nameVolumeWrapper....>
    </div>
</div>

スクリプトを更新

<script>
    function reloadContent() {
        $('#nameVolumeWrapper').load('${jsonAction} #nameVolumeWrapper');
    }
</script>

更新スクリプトを呼び出す要素

<sj:select href="%{jsonURL}" 
                 id="utility" 
               name="selectedUtility" 
               list="utilityList" 
          headerKey="-1" 
        headerValue="Please Select A Utility"
           onchange="reloadContent()"
     onChangeTopics="reloadSecondList"/>

リロードしようとしているdiv

<sj:div id="nameVolumeWrapper" listenTopics="reloadSecondList" 
        effect="pulsate" effectDuration="1000"
        cssStyle="height:250px; overflow-y: scroll; width:910px; 
        margin-left:auto; margin-right:auto;">
<table id="pricingInput" class="footable" style="width: 800px; 
        table-layout: fixed; margin-left: auto; margin-right: auto; 
        margin-bottom:50px;">
    <thead>
        <tr>
            <th style="text-align: center;">Account Name</th>
            <th style="text-align: center;">Annual kWh Volume</th>
            <th style="text-align: center">Rate Class</th>
            <th style="text-align: center;">Add Another?</th>
        </tr>
    </thead>
    <tbody>
        <tr>
            <td><s:textfield name="nameHolder" /></td>
            <td><s:textfield name="volumeHolder" /></td>
            <s:url id="jsonURL" action="jsonAction" namespace="/"/>
                <td>
                    <sj:select href="%{jsonURL}" 
                                 id="rate_class" name="rateHolder" 
                               list="rateClassList" 
                          headerKey="-1" 
                        headerValue="Please Select a RateClass"
                       reloadTopics="reloadSecondList"/>
                </td>
            <td>
                <input type="button" class="addButton" value="Add" />
                <input type="button" value="Delete" onclick="deleteRow(this)">
            </td>
        </tr>
    </tbody>                                    
</table>

簡単に言えば、javascriptまたはdivの定義を変更して、javascriptが呼び出されたときにdivが重複しないようにするにはどうすればよいですか?

4

1 に答える 1