As a self-taught web developer, I learned a lot of what I know by looking at other people’s source code. It’s unfortunate that I can’t do this on my iPhone with mobile Safari, at least not by default. That said, there are several methods you can use to view the source code of a site on your iPhone.
In-Browser Methods
In-browser solutions simply allow you to navigate to a specific page and type in the url you wish to see the code for. I found two that worked well, one of which inspired the other:
Bookmarklets
Bookmarklets allow you to avoid a lot of unnecessary typing on your iPhone by letting you jump from any web page straight to its rendered source code.
- Abe Fettig’s view source bookmarklet
- Dustin Caruso’s view source bookmarklet
Native App SolutionsThere will be times where you just want an app to do all the work for you. If your in one of those moods, you could use one of the following native apps.
- Source-View
Source View is a handy way to view a website’s source code – just as you would with the “view source” command in a desktop web browser.
The source is presented in a easy to read font, and you can zoom and scroll in the display, just as you can in Safari.
- View-Source
View Source enables you to view the source of web sites on your iPhone or iPod Touch, with the ability to set the browser type when getting the source and the functionality of emailing the source to anyone.
Command Line Method
If you want to view the source of an iPhone optimized website using something other than your iPhone, you may navigate to the site and get “this page is viewable only on an iPhone” or something similar. Scott Barr discovered this when he tried to view the source of an iPhone specific RSS feed. To work around this, he used the following methodwhich uses the curl command in terminal:
Thanks your Post.