A neat bit of javascript which allows you to view html source on an iPad or iPhone.
javascript:(function(){
var w = window.open('about:blank'),
s = w.document;
s.write('Source of ' + location.href + '');
s.close();
var pre = s.body.appendChild(s.createElement("pre"));
pre.style.overflow = 'auto';
pre.style.whiteSpace = 'pre-wrap';
pre.appendChild(s.createTextNode(document.documentElement.innerHTML));
})();
Just copy and save as a bookmarklet on mobile safari.
All credit for this goes to Rob Flaherty at Ravel Rumba.
For more details and a link to the bookmarklet – visit http://www.ravelrumba.com/blog/ipad-view-source-bookmarklet/
Filed under: code snippets