Error :: jQuery UI选项卡:不匹配的片段标识符

时间:2012-01-11 07:38:33

标签: javascript jquery asp.net asp.net-mvc

在我看来,我正在使用Jquery标签。最初的翻转对我来说很好。但是稍后当从tab-1视图中单击按钮(事件)以更改它的对话时,我再次使用切换到另一个选项卡(比如tab-2)并通过单击它返回到tab-1给出Error :: Eror :: jQuery UI选项卡:不匹配的片段标识符


脚本

 <script type="text/javascript">
    $(function () {
        $("#tabs").tabs({collapsible:true});
    });
</script>

  <script type="text/javascript">
   $(function () {
       $("#button").click(function () {
           $("#tabs-1").replaceWith($("h1")) 
        });
   });



查看

 <h1>Chenger heading for tab-1 after clicking the button</h1>
    <div id="tabs">
<ul>
    <li><a href="#tabs-1">Info</a></li>
    <li><a href="#tabs-2">Address</a></li>
    <li><a href="#tabs-3">Contacts</a></li>
</ul>
<div id="tabs-1">
    <table >
    <tr>
    <td>First Name</td>
    <td><%: Model.InfoName%></td>
    </tr>
    <tr><td>Last Name</td><td> <%: Model.infoLastName%></td></tr>
    <tr><td>Fathers Name</td><td> <%: Model.infoFatherName%></td></tr>
    </table>
    <input type="button" value="Edit" id="button" />
    </div>


为什么我得到这个?????

1 个答案:

答案 0 :(得分:0)

<script type="text/javascript"> $(function () { $("#button").click(function () { $("#tabs-1").replaceWith($("h1")) }); });