javascript - Applying json data to format style via jQuery -


i have odd problem following:

function loadtextbox(jsonurl,divid){     $.getjson(jsonurl, function(json) {         $('#' + divid).html('<h2>'+json.heading+'</h2>');         alert(json.config.headingconfig);         $('#' + divid).children().css(json.config.headingconfig);     }) } 

the alert above returns: {color: 'white', fontfamily:'arial, times, serif'} however, format of text not change.

now here odd part: if this:

function loadtextbox(jsonurl,divid){         $.getjson(jsonurl, function(json) {             $('#' + divid).html('<h2>'+json.heading+'</h2>');             alert(json.config.headingconfig);             $('#' + divid).children().css({color: 'white', fontfamily:'arial, times, serif'});         })     } 

it works fine... text format arial font , white. baffled... means there simple answer, ideas?

it looks json.config.headingconfig contains json string.

you need convert actual object calling $.parsejson.


Comments

Popular posts from this blog

python - Scipy curvefit RuntimeError:Optimal parameters not found: Number of calls to function has reached maxfev = 1000 -

c# - How to add a new treeview at the selected node? -

java - netbeans "Please wait - classpath scanning in progress..." -