Difference between revisions of "Lang Favlet"

From Level Access Web Labs
Jump to navigation Jump to search
Line 2: Line 2:
 
This Favlet uses the direct link technique and is too long to run in IE.
 
This Favlet uses the direct link technique and is too long to run in IE.
  
<a href="javascript:(function(){
+
<a href="javascript:(function(){var%20element=document.createElement('script');element.setAttribute('src','lang.js');document.body.appendChild(element);})();"> lang attributes Favlet </a>
var el = document.querySelectorAll('[lang]');
 
var str;
 
var headers=[];
 
var sentinel;
 
if (el.length>0) {
 
for (var i=0; i<el.length; i++) {
 
s = document.createElement('Span');
 
t = document.createTextNode(" lang="+el.item(i).lang +" ");
 
s.appendChild(t);
 
s.style.backgroundColor = 'antiqueWhite';
 
s.style.color = 'black';
 
el.item(i).insertBefore(s,el.item(i).firstChild);
 
}
 
}
 
else {
 
  alert('no language set');
 
}
 
})();"> Show lang attributes Favlet </a>
 
 
</html>
 
</html>
  
 
[[Category:Favlet]]
 
[[Category:Favlet]]

Revision as of 02:33, 4 February 2014

This Favlet uses the direct link technique and is too long to run in IE. lang attributes Favlet