var obj;
function JSONscriptRequest(fullUrl){
this.fullUrl=fullUrl;
this.noCacheIE='&noCacheIE=' + (new Date()).getTime();
if(document.getElementsByTagName("head").item(0) == null){
this.headLoc=document.getElementsByTagName("html").item(0);}else{
this.headLoc=document.getElementsByTagName("head").item(0);}
this.scriptId='JscriptId' + JSONscriptRequest.scriptCounter++;
}
JSONscriptRequest.scriptCounter=1;
JSONscriptRequest.prototype.buildScriptTag=function(){
this.scriptObj=document.createElement("script");
this.scriptObj.setAttribute("type", "text/javascript");
this.scriptObj.setAttribute("charset", "utf-8");
this.scriptObj.setAttribute("src", this.fullUrl + this.noCacheIE);
this.scriptObj.setAttribute("id", this.scriptId);
}
JSONscriptRequest.prototype.removeScriptTag=function(){
this.headLoc.removeChild(this.scriptObj);
}
JSONscriptRequest.prototype.addScriptTag=function(){
this.headLoc.appendChild(this.scriptObj);
}
function addScript(){
obj=new JSONscriptRequest('http://www.experts-exchange.com/shared/async/expertBadgesJSON.jsp?q=sJOwmJiMpOg=&bs=gNF5onwr908hn0gttZonwr908hn0gttiT4c=&fzn=hP3B0vIzMtk=&szn=hP3B0vIzMtk=&tzn=hP3B0vIzMtk=');
obj.buildScriptTag();
obj.addScriptTag();
}
function take(data){
if(data==null){alert('Error accessing data');}
document.getElementById('certifiedExpertNameMedium').innerHTML="" + data.memberName + "";
document.getElementById('certifiedExpertArticlesWrittenDataMedium').innerHTML=data.memberArticlesWritten;
document.getElementById('certifiedExpertPointsDataMedium').innerHTML=data.memberTotalPoints;
document.getElementById('certifiedExpertQuestionsAnsweredDataMedium').innerHTML=data.memberQuestionsAnswered;
document.getElementById('certifiedExpertMemberSinceMedium').innerHTML='MEMBER SINCE ' + data.memberSinceDate;
document.getElementById('certifiedExpertZoneRankMedium').innerHTML=data.memberZoneRank;
document.getElementById('certifiedExpertEEpleMedium').innerHTML=data.eeple;
document.getElementById('certifiedExpertZoneMedium1').innerHTML="" + data.memberZoneRank1 + "";
document.getElementById('certifiedExpertZoneMedium2').innerHTML="" + data.memberZoneRank2 + "";
document.getElementById('certifiedExpertZoneMedium3').innerHTML="" + data.memberZoneRank3 + "";
}
addScript();
No hay comentarios.:
Publicar un comentario