<i id='f9LmW'><tr id='f9LmW'><dt id='f9LmW'><q id='f9LmW'><span id='f9LmW'><b id='f9LmW'><form id='f9LmW'><ins id='f9LmW'></ins><ul id='f9LmW'></ul><sub id='f9LmW'></sub></form><legend id='f9LmW'></legend><bdo id='f9LmW'><pre id='f9LmW'><center id='f9LmW'></center></pre></bdo></b><th id='f9LmW'></th></span></q></dt></tr></i><div id='f9LmW'><tfoot id='f9LmW'></tfoot><dl id='f9LmW'><fieldset id='f9LmW'></fieldset></dl></div>

    1. <tfoot id='f9LmW'></tfoot>
    2. <legend id='f9LmW'><style id='f9LmW'><dir id='f9LmW'><q id='f9LmW'></q></dir></style></legend>
        <bdo id='f9LmW'></bdo><ul id='f9LmW'></ul>

      <small id='f9LmW'></small><noframes id='f9LmW'>

    3. 尝试使用 id==valores0 注册小部件,但该 id 已注册

      时间:2024-04-19
      • <bdo id='LkH5S'></bdo><ul id='LkH5S'></ul>
        <tfoot id='LkH5S'></tfoot>
                <tbody id='LkH5S'></tbody>

                <small id='LkH5S'></small><noframes id='LkH5S'>

                <i id='LkH5S'><tr id='LkH5S'><dt id='LkH5S'><q id='LkH5S'><span id='LkH5S'><b id='LkH5S'><form id='LkH5S'><ins id='LkH5S'></ins><ul id='LkH5S'></ul><sub id='LkH5S'></sub></form><legend id='LkH5S'></legend><bdo id='LkH5S'><pre id='LkH5S'><center id='LkH5S'></center></pre></bdo></b><th id='LkH5S'></th></span></q></dt></tr></i><div id='LkH5S'><tfoot id='LkH5S'></tfoot><dl id='LkH5S'><fieldset id='LkH5S'></fieldset></dl></div>
                <legend id='LkH5S'><style id='LkH5S'><dir id='LkH5S'><q id='LkH5S'></q></dir></style></legend>

                本文介绍了尝试使用 id==valores0 注册小部件,但该 id 已注册的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                问题描述

                我得到这个错误,我不知道如何解决.我阅读了 此链接 之前.

                i get this error, and i don't know how can be solved. I read this link before.

                1

                index.php

                <script type="text/javascript">
                $(document).ready(function() {   
                    $("#customForm").submit(function() {
                        var formdata = $("#customForm").serializeArray();
                
                        $.ajax({
                            url: "sent.php",
                            type: "post",
                            dataType: "json",
                            data: formdata,
                            success: function(data) {
                                switch (data.livre) {
                                case 'tags':
                                    $("#msgbox2").fadeTo(200, 0.1, function() {
                                        $(this).html('Empty tags').fadeTo(900, 1);
                                    });
                                    break;
                
                                default:
                                    $("#msgbox2").fadeTo(200, 0.1, function() {
                                        $(this).html('Update').fadeTo(900, 1, function() {
                                            $('#conteudo').load('dojo/test_Slider.php');   
                                        });
                                    });
                                    break;
                                }
                            }
                        });
                
                        return false;
                    });
                });
                </script>
                

                test_slider.php

                test_slider.php

                <script type="text/javascript">
                
                var slider = [];
                
                for (i = 0; i < 5; i++) {
                
                    slider[i] = (
                
                    function(i) {
                
                        return function() {
                
                            var node = dojo.byId("input"+[i]);
                            var n = dojo.byId("valores"+[i]);
                
                            var rulesNode = document.createElement('div'+[i]);
                            node.appendChild(rulesNode);
                
                            var sliderRules = new dijit.form.HorizontalRule({
                                count:11,
                                style:{height:"4px"}
                            },rulesNode);
                
                            var labels = new dijit.form.HorizontalRuleLabels({
                                style:{height:"1em",fontSize:"75%"},
                            },n);
                
                            var theSlider = new dijit.form.HorizontalSlider({
                                value:5,
                                onChange: function(){
                                    console.log(arguments);
                                },
                                name:"input"+[i],
                                onChange:function(val){ dojo.byId('value'+[i]).value = dojo.number.format(1/val,{places:4})},
                                style:{height:"165px"},
                                minimum:1,
                                maximum:9,
                                   }
                            },node);
                
                            theSlider.startup();
                                sliderRules.startup();
                        }
                
                    })(i);
                    dojo.addOnLoad(slider[i]);
                }
                
                </script>
                

                问题:首先点击提交 btn 一切正常,导入了 5 个滑块.第二次单击,应该更新,但我收到此消息:

                Problem: First click in submit btn all works well, 5 sliders are imported. Second click, an update is supposed, but i get this message:

                Tried to register widget with id==valores0 but that id is already registered
                

                [演示视频]2

                推荐答案

                只是为了补充@missingo 的答案和@Kevin 的评论.您可以通过查看注册表来浏览现有的 dijit:

                Just to add on to @missingo's answer and @Kevin's comment. You could walk through the existing dijits by looking in the registry:

                var i = i || 0; // Cache this at the end of your loop
                dijit.registry.map(function (widget) {
                    if (+widget.id.replace(/^[^d]+/, '') <  i) {
                        widget.destroyRecursive();
                    }
                });
                /*
                    Your loop fixed as described in missingno's answer.
                */
                

                这篇关于尝试使用 id==valores0 注册小部件,但该 id 已注册的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                上一篇:如何让滑块的值实时更新? 下一篇:jQuery 圆形滑块

                相关文章

              1. <legend id='LLRan'><style id='LLRan'><dir id='LLRan'><q id='LLRan'></q></dir></style></legend>

                    <bdo id='LLRan'></bdo><ul id='LLRan'></ul>
                  <tfoot id='LLRan'></tfoot>
                1. <i id='LLRan'><tr id='LLRan'><dt id='LLRan'><q id='LLRan'><span id='LLRan'><b id='LLRan'><form id='LLRan'><ins id='LLRan'></ins><ul id='LLRan'></ul><sub id='LLRan'></sub></form><legend id='LLRan'></legend><bdo id='LLRan'><pre id='LLRan'><center id='LLRan'></center></pre></bdo></b><th id='LLRan'></th></span></q></dt></tr></i><div id='LLRan'><tfoot id='LLRan'></tfoot><dl id='LLRan'><fieldset id='LLRan'></fieldset></dl></div>

                  <small id='LLRan'></small><noframes id='LLRan'>