I’m trying to create a PHP backend that is flexible enough so it doesn’t required to be re-coded to any fronted I may want to use. Part of this I’m trying to pass JSON from the backend that would then be transformed into a msgbox.
This is from my test page and Firebug keeps giving me an error saying:
missing : after property id
mybutton.title: mybutton.action
referring to the mybutton.title value.
This is the code i’m playing with:
var mybutton = new Object();
var mybutton = {'title': 'Done', 'action': function (){$(this).remove();}};
var title = mybutton.title;
var msg = "hello from the grave";
$("#SiteHolder").html(msg);
$("#SiteHolder").dialog({ autoOpen: true, autoResize: true, width: 600, close: function(event, ui){$(this).remove();}, buttons: {
mybutton.title: mybutton.action
}
});
I also tried assigning the mybutton.title to an variable but it only returns the variable name and not the contents.
Please keep in mind that at some point this will be expanded to an array of buttons.
You can’t have object key
mybutton.titleit will not evaluate. Instead: