星期四, 2月 15, 2007

Force Wrap - Bookmarklet

http://userscripts.org/scripts/show/1847

Intro:Use <wbr> tag to wrap the long words and refresh the inner html page after it was finished.

Force Wrap (Drag it to your Bookmarks/Favorites)

 
javascript:(function(){var D=document; F(D.body); function F(n){var u,r,c,x; if(n.nodeType==3){ u=n.data.search(/\S{45}/); if(u%3E=0) { r=n.splitText(u+45); n.parentNode.insertBefore(D.createElement(%22WBR%22),r); } }else if(n.tagName!=%22STYLE%22 && n.tagName!=%22SCRIPT%22){for (c=0;x=n.childNodes[c];++c){F(x);}} } })();document.body.innerHTML = document.body.innerHTML; void 0;


Here is the WBR tag test Page:
http://www.quirksmode.org/oddsandends/wbr.html

沒有留言: