View Source on Safari

I have an iPad Air, about 2 months old.

How can I view source on a web page; I need it to debug something I'm developing.

Thanks
Richard KortsAsked:
Who is Participating?
 
serialbandConnect With a Mentor Commented:
In the Bookmark, Give it the name View Source.

Then, where you normally have a link, put this code as the bookmark link.

javascript:(function(){var d=window.open('about:blank'),a=d.document;a.write('<!DOCTYPE html><html><head><title>Loading Source</title></head><body></body></html>');a.close();var b=a.body.appendChild(a.createElement('form'));b.setAttribute('method','post');b.setAttribute('action','http://ole.michelsen.dk/viewsource/?uri='+location.href);var c=b.appendChild(a.createElement('input'));c.setAttribute('type','hidden');c.setAttribute('name','DOM');c.setAttribute('value',encodeURIComponent(document.documentElement.innerHTML));b.submit()})()

Open in new window


In your image, you paste that code into the section where you have http://fwsprinklercdb.infoupdt...
0
 
Mohammed KhawajaManager - Infrastructure:  Information TechnologyCommented:
0
 
Richard KortsAuthor Commented:
To Mohammed Khawaja,

Mine does not work that way. See attached.

Thanks
image.jpg
0
Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

 
JohnBusiness Consultant (Owner)Commented:
I wonder if this is IOS dependent. My iPhone with Safari works like your picture rkorts.
0
 
JohnBusiness Consultant (Owner)Commented:
I tried the second link but could not get it to work. I will work at trying it again.
0
 
Richard KortsAuthor Commented:
I got around the problem I had; it was an error in my Javascript.

But it would still be nice to be able to view source in Safari.

Thanks
0
 
serialbandCommented:
Are you unable to view the source?  I've done it on an iphone and it works.

Both links have the same Javascript code.  You just have to create a bookmark with that javascript code as the "link".  It will "pop up" a new window with the page source that you just need switch to.  When you click on that bookmark, it just runs the javascript code on the current page that you're on.
0
 
Richard KortsAuthor Commented:
To serialband,

I don't understand your comment. Can you elaborate?

Thanks
0
 
serialbandCommented:
Some of those points should have gone to the others.  At the very least to @Mohammed Khawaja for providing the links.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.