javascript - error :id is already registered -


i have error in code

error: tried register widget id==legend1 id registered 

the code legend is:

    <div id="legend1"></div>      var stackedarealegend = new dojox.charting.widget.selectablelegend({     chart: chart1     }, "legend1");        stackedarealegend.refresh();  

how can solve error?

try destroy widget before creating new:

var stackedarealegend = dijit.byid('legend1'); if (stackedarealegend) {    stackedarealegend.destroyrecursive(true); }  stackedarealegend = new dojox.charting.widget.selectablelegend({     chart: chart1     }, "legend1");     stackedarealegend.refresh();  

Comments

Popular posts from this blog

Cursor error with postgresql, pgpool and php -

delphi - ESC/P programming! -

c++ - error: use of deleted function -