(function () { var tblzrid = document.getElementById("trailblazerWidget").getAttribute("trailblazerid"); var xmlHttp = new XMLHttpRequest(); xmlHttp.open( "GET", 'https://forceleaderboard-developer-edition.na50.force.com/services/apexrest/trailblazer?id='+tblzrid, false ); // false for synchronous request xmlHttp.send( ); var obj = JSON.parse(xmlHttp.responseText); var widgetDiv = '
Badges | Points | '; widgetDiv += 'Certification | '; widgetDiv += '
'+obj.Badges+' | '+obj.Points+' | '; if( obj.Certifications != '' && obj.Certifications != null && obj.Certifications != 0 ){ widgetDiv += ''+obj.Certifications+''; } else{ widgetDiv += '-'; } widgetDiv += ' |