I’m having trouble with a content pane in Dojo where it is appearing for a second with the content then disappearing. I am getting the following error:
Uncaught ReferenceError: dijit is not defined index.php:22
dojo/parser::parse() error
Error
arguments: undefined
get stack: function () { [native code] }
message: "Tried to register widget with id==centerPane but that id is already registered"
set stack: function () { [native code] }
type: undefined
__proto__: d
I have come accross answer where you can destroy all registered ID’s but I am still getting the error when I try them.
var ids = ["contentPane"];
dijit.registry.forEach(function(w){
if(dojo.indexOf(ids,id)){
w.destroyRecursive();
}
});
and
var ids = ["contentPane"];
dijit.registry.forEach(function(w){
if(dojo.indexOf(ids,1)){ // 1 will be yourid it will get destroy
w.destroyRecursive();
}
});
How do I solve this error?
Solved it, was something simple but I’ll stick the answer up in case anyone else does my mistake.
My original code:
Fixed code: