{"id":16,"date":"2011-04-25T07:38:00","date_gmt":"2011-04-25T07:38:00","guid":{"rendered":"http:\/\/mattdturner.com\/wordpress\/?p=16"},"modified":"2012-03-19T07:48:48","modified_gmt":"2012-03-19T13:48:48","slug":"finding-text-on-any-website-on-the-ipad-iphone-and-ipod","status":"publish","type":"post","link":"https:\/\/mattdturner.com\/wordpress\/2011\/04\/finding-text-on-any-website-on-the-ipad-iphone-and-ipod\/","title":{"rendered":"Finding Text on Any Website on the iPad, iPhone, and iPod"},"content":{"rendered":"<p><a href=\"http:\/\/mattdturner.com\/wordpress\/wp-content\/uploads\/2011\/04\/FindInPage.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignright size-medium wp-image-65\" title=\"FindInPage\" src=\"http:\/\/mattdturner.com\/wordpress\/wp-content\/uploads\/2011\/04\/FindInPage-200x300.jpg\" alt=\"Find in Page Javascript\" width=\"200\" height=\"300\" srcset=\"https:\/\/mattdturner.com\/wordpress\/wp-content\/uploads\/2011\/04\/FindInPage-200x300.jpg 200w, https:\/\/mattdturner.com\/wordpress\/wp-content\/uploads\/2011\/04\/FindInPage.jpg 320w\" sizes=\"(max-width: 200px) 100vw, 200px\" \/><\/a><\/p>\n<p><strong>EDIT: <\/strong>Apparently this is now <a href=\"http:\/\/www.tipb.com\/2010\/09\/16\/ios-42-features-find-text-safari-web-page\/\">included in iOS 4.2<\/a>. \u00a0Thanks go to Mowg for bringing this to my attention.<\/p>\n<p>One rather frustrating thing that I have noticed with the iPad (and iPhone) is the inability to search for text within Safari. \u00a0Well as it turns out, a simple javascript bookmark is all you need to add this functionality to any iOS device (just like my post on <a href=\"http:\/\/mattdturner.com\/wordpress\/2011\/04\/how-to-view-html-source-code-on-ios-ipad-iphone-ipod\/\">viewing source code<\/a>).<\/p>\n<p>To enable finding text within any website, follow the below instructions:<\/p>\n<ol>\n<li>Open Safari (pretty self explanatory).<\/li>\n<li>Create a new bookmark.<\/li>\n<li>In the Title window, write whatever you want your bookmark to be named (I chose &#8220;Find on Page&#8221;)<\/li>\n<li>In the address bar add the following javascript code:\n<pre class=\"brush: plain; light: true; title: ; notranslate\" title=\"\">javascript:void(s=prompt('Find text:',''));s='('+s+')';x=new RegExp(s,'gi');\r\nrn=Math.floor(Math.random()*100);rid='z' + rn;b = document.body.innerHTML;\r\nb=b.replace(x,'&amp;lt;span id=&amp;quot; + rid + &amp;quot;&amp;gt;$1&amp;lt;\/span&amp;gt;');void(document.body.innerHTML\r\n=b);alert('Found ' + document.getElementsByName(rid).length + ' matches.');\r\nwindow.scrollTo(0,document.getElementsByName(rid)[0].offsetTop);<\/pre>\n<\/li>\n<\/ol>\n<p><strong>NOTE<\/strong>: The entire javascript should be on one line. \u00a0As with the post on viewing source code, I did not develop this javascript bookmark. All credit goes to Matthew Panzarino\u00a0(<strong>Edit:\u00a0<\/strong>link seems to be dead now).<\/p>\n<div class=\"zemanta-pixie\" style=\"margin-top: 10px; height: 15px;\"><a class=\"zemanta-pixie-a\" title=\"Enhanced by Zemanta\" href=\"http:\/\/www.zemanta.com\/\"><img decoding=\"async\" class=\"zemanta-pixie-img\" style=\"border: none; float: right;\" src=\"http:\/\/img.zemanta.com\/zemified_e.png?x-id=4974a084-60a0-4801-83f6-893ffbf2387f\" alt=\"Enhanced by Zemanta\" \/><\/a><\/div>\n","protected":false},"excerpt":{"rendered":"<p>EDIT: Apparently this is now included in iOS 4.2. \u00a0Thanks go to Mowg for bringing this to my attention. One rather frustrating thing that I have noticed with the iPad (and iPhone) is the inability to search for text within Safari. \u00a0Well as it turns out, a simple javascript bookmark is all you need to [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[4,5],"tags":[17,8,40,7,52,53,54,51],"class_list":["post-16","post","type-post","status-publish","format-standard","hentry","category-ipad","category-iphone","tag-apple","tag-ios","tag-ipad-2","tag-iphone-2","tag-ipod-touch","tag-javascript","tag-languages","tag-safari","no-thumb"],"_links":{"self":[{"href":"https:\/\/mattdturner.com\/wordpress\/wp-json\/wp\/v2\/posts\/16"}],"collection":[{"href":"https:\/\/mattdturner.com\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mattdturner.com\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mattdturner.com\/wordpress\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mattdturner.com\/wordpress\/wp-json\/wp\/v2\/comments?post=16"}],"version-history":[{"count":8,"href":"https:\/\/mattdturner.com\/wordpress\/wp-json\/wp\/v2\/posts\/16\/revisions"}],"predecessor-version":[{"id":350,"href":"https:\/\/mattdturner.com\/wordpress\/wp-json\/wp\/v2\/posts\/16\/revisions\/350"}],"wp:attachment":[{"href":"https:\/\/mattdturner.com\/wordpress\/wp-json\/wp\/v2\/media?parent=16"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mattdturner.com\/wordpress\/wp-json\/wp\/v2\/categories?post=16"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mattdturner.com\/wordpress\/wp-json\/wp\/v2\/tags?post=16"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}