MyBlogTalk
September 10, 2010, 09:55:52 PM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News: SMF - Just Installed!
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: How to enable HTML in Blogger Posts  (Read 2565 times)
0 Members and 1 Guest are viewing this topic.
sunntz
Newbie
*

Rep Points: 0
Offline Offline

Posts: 1


View Profile
« on: May 24, 2009, 12:59:40 PM »

The below JavaScript disables HTML tags in my Blog[www.gadgetcage.com] posts. How to enable HTML tags?

Here's the code for review:
function removeHtmlTag(strx,chop){
   if(strx.indexOf("<")!=-1)
   {
      var s = strx.split("<");
      for(var i=0;i<s.length;i++){
         if(s.indexOf(">")!=-1){
            s = s.substring(s.indexOf(">")+1,s.length);
         }
      }
      strx =  s.join("");
   }
   chop = (chop < strx.length-1) ? chop : strx.length-2;
   while(strx.charAt(chop-1)!=' ' && strx.indexOf(' ',chop)!=-1) chop++;
   strx = strx.substring(0,chop-1);
   return strx+'...';
}

function createSummaryAndThumb(pID){
   var div = document.getElementById(pID);
   var imgtag = "";
   var img = div.getElementsByTagName("img");
   var summ = summary_noimg;
   if(img.length>=1) {   
      imgtag = '<span style="float:center; padding:0px 10px 5px 0px;"><img src="'+img[0].src+'" width="'+img_thumb_width+'px" height="'+img_thumb_height+'px"/></span>';
      summ = summary_img;
   }
   
   var summary = imgtag + '<div>' + removeHtmlTag(div.innerHTML,summ) + '</div>';
   div.innerHTML = summary;
}
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.7 | SMF © 2006-2008, Simple Machines LLC Valid XHTML 1.0! Valid CSS!