I was unable to use eval because the the json keys and values are surrounded by " ". My navigation is created in by the yui library. The format it needs to be in is this:
[
{"text":"Home"},
{"text":"Catalog","submenu":
{"id":"catalogSub","itemdata":
[
{"text":"Catalog", onclick: {fn: somefunction}},
{"text":"Add Book", onclick: {fn: function(){dosomething();}}}
]
}
},
{"text":"Patrons"}
]
I can create a javascript file that i can dynamically load and execute, but that would involve having to iterate throught the entire array, and involve a lot of extra work. If it comes to that I guess I'd have to, but I would really like a better way. Is there someway to convert a string to a function?