Daca vrei sa adaugi pe site posibilitatea ca vizitatorii sa te adauge la Google Reader
<a href=”http://razvan.pevarf.org/#” href=”http://razvan.pevarf.org/#” onclick=”googleAdd()”>Add to Google Reader</a>
si in JavaScript sa adaugi functia:
function googleAdd () {
 var f=false;
 var ls=document.getElementsByTagName(‘link’);
 for(var i=0,l;l=ls[i];i++) {
  var t=l.getAttribute(‘type’);
  var r=l.getAttribute(‘rel’);
  if ( t && (t==’application/rss+xml’||t==’application/atom+xml’) && r &&r==’alternate’) {
   var h = l.getAttribute(‘href’);
   if (h.indexOf(‘http’)!=0) {
    var p=(h.indexOf(‘/’)!=0)?’/’:location.pathname;
    h=’http://’+location.hostname+p+h;
   }
   window.location = ‘http://google.com/reader/view/feed/’+h;
   f = true;
   break;
  }
 }
 if (!f) {
  alert(‘Can\’t find a feed.’);
 }Â
}
 var f=false;
 var ls=document.getElementsByTagName(‘link’);
 for(var i=0,l;l=ls[i];i++) {
  var t=l.getAttribute(‘type’);
  var r=l.getAttribute(‘rel’);
  if ( t && (t==’application/rss+xml’||t==’application/atom+xml’) && r &&r==’alternate’) {
   var h = l.getAttribute(‘href’);
   if (h.indexOf(‘http’)!=0) {
    var p=(h.indexOf(‘/’)!=0)?’/’:location.pathname;
    h=’http://’+location.hostname+p+h;
   }
   window.location = ‘http://google.com/reader/view/feed/’+h;
   f = true;
   break;
  }
 }
 if (!f) {
  alert(‘Can\’t find a feed.’);
 }Â
}
Facebook Comments