查看ipad网页代码 iPad Quick Tip – View Page Source In iPad Safari

 

If you are a webmaster like me, and always wondered how to check the source of your web pages via your iPad, search no more: the folks at RavelRumba put together a nice “bookmarklet” that will allow you to have access to the source of the page you are looking at, simply by using a bookmark.

To get it to work, simply follow these steps:

 

  1. Go to this page, and copy the bookmarklet (tap for more than 1 second, hit “Select All” then “Copy”).
  2. Create a bookmark via the “Add Bookmark” function in Safari (the plus sign next to the address bar). Don’t worry about the actual page you are bookmarking, it does not matter.
  3. Open the “Bookmark Bar” (the icon that looks like a book), tap “Edit” to edit the bookmark you just created. Replace the bookmark name with something friendly like “Check Source”, and delete the address that was initially bookmarked. Replace it with the code you just copied (long tap, then “Paste”).
  4. Save the bookmark.

 

And voila, your iPad will now display the source of the page you are looking at, every time you use the “Check Source” bookmark. Kudos to RavelRumba for this simple yet extremely useful feature.

 

核心内容就是把下面的代码保存到书签网址里面:

 

 

javascript:(function(){var a=window.open('about:blank').document;a.write('<!DOCTYPE html><html><head><title>Source of '+location.href+'</title><meta name="viewport" content="width=device-width" /></head><body></body></html>');a.close();var b=a.body.appendChild(a.createElement('pre'));b.style.overflow='auto';b.style.whiteSpace='pre-wrap';b.appendChild(a.createTextNode(document.documentElement.innerHTML))})();

 

如果想查看当前网页的代码,就直接点击这个书签。

 

来源:   http://www.padgadget.com/2010/05/15/ipad-quick-tip-view-page-source-in-ipad-safari/

 

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值