Hello,
I trying to assign icons to buttons Ive created but Im getting an initialization error . Do I have to do the button icon assignment in a callback?
Uncaught cannot call methods on button prior to initialization; attempted to call method 'option'
But the button has been instantiated here is my code ...
$(document).ready(function(){
$("img").attr("src","");
$("a").has("img").button();
$("img").each(function(x) {
if ($(this).data('icon') == "") {
$label.push($(this).attr("alt"));
$(this).button("option","label",$label[x]);
} else {
$label.push($(this).data('icon'));
$(this).button("option","icons",{primary: $label[x]});
}
});