{"id":17,"date":"2011-04-22T09:02:00","date_gmt":"2011-04-22T09:02:00","guid":{"rendered":"http:\/\/mattdturner.com\/wordpress\/?p=17"},"modified":"2011-04-26T14:14:40","modified_gmt":"2011-04-26T20:14:40","slug":"how-to-view-html-source-code-on-ios-ipad-iphone-ipod","status":"publish","type":"post","link":"http:\/\/mattdturner.com\/wordpress\/2011\/04\/how-to-view-html-source-code-on-ios-ipad-iphone-ipod\/","title":{"rendered":"How to View HTML Source Code on iOS | iPad, iPhone, iPod"},"content":{"rendered":"<p>Occasionally, when browsing the web I have a need to view the source code for a certain page. \u00a0However, there is no intrinsic way to do so on the iOS version of safari. \u00a0Well, using some simple javascript bookmark you can view the source code for any webpage.<\/p>\n<p>To view the source code, follow the below instructions:<\/p>\n<ol>\n<li>Open Safari (duh!)<\/li>\n<li>Click the &#8220;Add Bookmark&#8221; button in Safari.<\/li>\n<li>Give the bookmark whatever name you wish; I chose the title &#8220;View Source&#8221;.<\/li>\n<li>In the address bar of your new bookmark, paste the following code:\n<pre class=\"brush: plain; light: true; title: ; notranslate\" title=\"\"> javascript:var%20sourceWindow%20%3D%20window.open%28%27about%3Ablank%27%29%3B\r\n%20%0Avar%20newDoc%20%3D%20sourceWindow.document%3B%20%0AnewDoc.open%28%29%3B\r\n%20%0AnewDoc.write%28%27%3Chtml%3E%3Chead%3E%3Ctitle%3ESource%20of%20%27%20%2B\r\n%20document.location.href%20%2B%20%27%3C\/title%3E%3C\/head%3E%3Cbody%3E%3C\/body\r\n%3E%3C\/html%3E%27%29%3B%20%0AnewDoc.close%28%29%3B%20%0Avar%20pre%20%3D\r\n%20newDoc.body.appendChild%28newDoc.createElement%28%22pre%22%29%29%3B%20\r\n%0Apre.appendChild%28newDoc.createTextNode%28document.documentElement.innerHTML\r\n%29%29%3B<\/pre>\n<\/li>\n<li>Now just navigate to whichever page you wish to view the source of, click the bookmarks button, and select your new View Source bookmark.<\/li>\n<\/ol>\n<div><strong>NOTE:<\/strong> The entire code should be on a single line.  I did not create this javascript bookmark. \u00a0I only discovered it while browsing the internet. \u00a0For the source of the javascript bookmark, please see <a href=\"http:\/\/banagale.com\/view-source-from-safari-on-ipad.htm\">Rob&#8217;s Blog<\/a>.<\/div>\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=141ca648-4cb9-40d9-a890-65a8cede9732\" alt=\"Enhanced by Zemanta\" \/><\/a><\/div>\n","protected":false},"excerpt":{"rendered":"<p>Occasionally, when browsing the web I have a need to view the source code for a certain page. \u00a0However, there is no intrinsic way to do so on the iOS version of safari. \u00a0Well, using some simple javascript bookmark you can view the source code for any webpage. To view the source code, follow the [&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":[56,17,8,40,7,53,55,23],"class_list":["post-17","post","type-post","status-publish","format-standard","hentry","category-ipad","category-iphone","tag-android","tag-apple","tag-ios","tag-ipad-2","tag-iphone-2","tag-javascript","tag-safari-web-browser","tag-source-code","no-thumb"],"_links":{"self":[{"href":"http:\/\/mattdturner.com\/wordpress\/wp-json\/wp\/v2\/posts\/17"}],"collection":[{"href":"http:\/\/mattdturner.com\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/mattdturner.com\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/mattdturner.com\/wordpress\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/mattdturner.com\/wordpress\/wp-json\/wp\/v2\/comments?post=17"}],"version-history":[{"count":3,"href":"http:\/\/mattdturner.com\/wordpress\/wp-json\/wp\/v2\/posts\/17\/revisions"}],"predecessor-version":[{"id":68,"href":"http:\/\/mattdturner.com\/wordpress\/wp-json\/wp\/v2\/posts\/17\/revisions\/68"}],"wp:attachment":[{"href":"http:\/\/mattdturner.com\/wordpress\/wp-json\/wp\/v2\/media?parent=17"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/mattdturner.com\/wordpress\/wp-json\/wp\/v2\/categories?post=17"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/mattdturner.com\/wordpress\/wp-json\/wp\/v2\/tags?post=17"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}