I am building a jQuery plugin for a homework assignment. I am inserting an object into my plugin, as a parameter.
Basically, it looks like this:
$('elem').pluginName({
structure: {
firstButton: "home.html"
secondButton: {
"Submenu 1": "submenu1.html",
"Submenu 2": "submenu2.html"
}
thirdButton: {
"Submenu 1": {
"Subsubmenu 1": "subsub1.html"
}
}
}
});
I want a user to be able to enter any possible structure, so I want to be able to loop infinitely deep into the structure
object. I don't know how to, I am hoping someone can help me out.