So far i was using Safari 4 for testing and debugging my current jQuery Plugin, but as i tried my code out in Firefox it started to complain about something within the JQuery-Framework: "setting a property that has only a getter". I tried to find out wich line exactly causes Firefox to complain and found out that this happens somewhere here**
$.fn.util.create_$dom = function(opt) {
var $dom = {};
$.each(opt.dom,function(name,val){
console.log(name);
var $elm = $('<div>');
$.each(opt.dom[name],function(_name,_val){
if(_name == 'tagName') $elm = $('<'+_val+'/>');
});
console.log(name+': ok');
$.each(opt.dom[name],function(_name,_val){ **here
switch(_name){ **here
case 'className': $elm.addClass(_val); **here
default: $elm.attr(_name, _val); **here
} **here
});
$dom[name] = $elm;
console.log(name+': ok');
});
return $dom;
};
options.dom looks like this:
dom:{
wrapper:{className:'wrapper'},
inner:{tagName:'p',className:'test',test:'bla'}
},