Well here is what I’m trying to do.
I want to convert a array which contains CSS rules like so:
[
".divd { bottom: 0px; height: 500px; }"
,
".divk { font-size: 14px; }"
]
I want to turn this into:
cssarray['divd'] = {
bottom: "0px",
height: "500px",
};
Here is what i’ve done so far:
var splitSelector= css.split("{");
var splitProperty = split[1].split(";");
var v =[];
for(i in splitProperty ){
v = $.extend(v,splitProperty[i].split(":"));
}
I have tried to get this work with lot’s of split statements but im out of luck.
See this fiddle: http://jsfiddle.net/YrQ7B/3/
The log: