I have a blog template that I downloaded for use on my blogger account, and I was having some trouble with an undefined box that's supposed to display the date for each post. I'm more keen on HTML than JS, so I was wondering if anyone could help me with it. I attached a picture of the box in question, and here's the part of the code which I believe is the problem.
function rp(json){docume nt.write('<ul>' );for(var i=0;i<numposts; i++){document.w rite('<li>');va r entry=json.feed .entry[i];var posttitle=entry .title.$t;var posturl;if(i==j son.feed.entry. length)break;fo r(var k=0;k<entry.lin k.length;k++){i f(entry.link[k].rel=='alternat e'){posturl=ent ry.link[k].href;break}}po sttitle=posttit le.link(posturl );var readmorelink="( more)";readmore link=readmoreli nk.link(posturl );var postdate=entry. published.$t;va r cdyear=postdate .substring(0,4) ;var cdmonth=postdat e.substring(5,7 );var cdday=postdate. substring(8,10) ;var monthnames=new Array();monthna mes[1]="Jan";monthnam es[2]="Feb";monthnam es[3]="Mar";monthnam es[4]="Apr";monthnam es[5]="May";monthnam es[6]="Jun";monthnam es[7]="Jul";monthnam es[8]="Aug";monthnam es[9]="Sep";monthnam es[10]="Oct";monthnam es[11]="Nov";monthnam es[12]="Dec";if("cont ent"in entry){var postcontent=ent ry.content.$t}e lse if("summary"in entry){var postcontent=ent ry.summary.$t}e lse var postcontent=""; var re=/<\S[^>]*>/g;postcontent=p ostcontent.repl ace(re,"");docu ment.write(post title);if(showp ostdate==true)d ocument.write(' - '+monthnames[parseInt(cdmont h,10)]+' '+cdday);if(sho wpostsummary==t rue){if(postcon tent.length<num chars){document .write(postcont ent)}else{postc ontent=postcont ent.substring(0 ,numchars);var quoteEnd=postco ntent.lastIndex Of(" ");postcontent= postcontent.sub string(0,quoteE nd);document.wr ite(postcontent +'...'+readmore link)}}document .write('</li>')}document. write('</ul>')}
Comment