You’re using your iPad to browse the Web and you’re curious to view the source of a webpage but don’t have the options to do so. The next thing you know, you’re swapping back to your Mac or PC to open up the same website to check the Page Source. Now if that isn’t called a hassle, I don’t know what is.

To make things easier for all iPad and iPhone users out there, here’s a trick to allow you to view the source of a webpage straight from your mobile device. Take note that the code you will be using will redirect you to the creator’s website, where the source is presented in highlighted syntax and clickable URL for easier reading.

Set up ‘View Source’ Bookmark

  1. To get started, open your mobile Safari on your Apple device and bookmark the page you are reading by clicking on the bookmark button. Instead of the page name, name it ‘View Source’ and then click ‘Save’.

    手机查看网页代码 How to View Website Source Codes on iPad / iPhone
  2. Open this bookmarklet javascript, select all and copy the script.
    手机查看网页代码 How to View Website Source Codes on iPad / iPhone

    代码:

    javascript:(function(){var w = window.open('about:blank'),d = w.document;d.write('');d.close();var f = d.createElement('form');f.setAttribute('method','post');f.setAttribute('action','https://ole.michelsen.dk/viewsource/?uri='+encodeURIComponent(location.href));var i = d.createElement('input');i.setAttribute('type','hidden');i.setAttribute('name','DOM');i.setAttribute('value',encodeURIComponent(document.documentElement.innerHTML));d.body.appendChild(f).appendChild(i);f.submit();
    })();

  3. Tap on the bookmark icon at the top left part of your mobile Safari browser, and tap on ‘Edit’
    手机查看网页代码 How to View Website Source Codes on iPad / iPhone
  4. Tap on the ‘View Source’ bookmark you created in step 1.
    手机查看网页代码 How to View Website Source Codes on iPad / iPhone
  5. Now paste the bookmarklet javascript you copied in step 2 into the URL bar and tap ‘Done’.
    手机查看网页代码 How to View Website Source Codes on iPad / iPhone

View Source On Safari on iPad and iPhone

Now that you have created a new bookmark called ‘View Source’, to view source of any webpage, open any site from your Safari browser, tap on the bookmark icon and then tap on the ‘View Source’ bookmark.

手机查看网页代码 How to View Website Source Codes on iPad / iPhone

This bookmark shortcut will send a request to the creator’s server for processing and then open a new browser tab for you to view the source in highlighted syntax.

手机查看网页代码 How to View Website Source Codes on iPad / iPhone

Conclusion

This method to ‘view source’ is not similar to web developer tools where you have it as an extension to your browser, but creating this bookmark is to save a shortcut to the creator’s website where you can view any website’s source with highlighted syntax.

源自:http://www.hongkiat.com/blog/view-source-codes-in-ipad-iphone/

同样的方法,你也可以使用firebug的js

javascript:(function(){ var fb = document.createElement('script');
fb.type = 'text/javascript'; fb.src = 'https://getfirebug.com/firebug-lite.js#startOpened';
document.getElementsByTagName('body')[0].appendChild(fb); })();

源自: https://getfirebug.com/firebuglite_mobile

原文/转自: 手机查看网页代码 How to View Website Source Codes on iPad / iPhone

手机firebug查看网页代码 How to View Website Source Codes on iPad / iPhone相关推荐

  1. 利用火狐浏览器Firebug查看网页相关属性

    核心提示:Firebug从各个不同的角度剖析Web页面内部的细节层面,给Web开发者带来很大的便利. Firebug从各个不同的角度剖析Web页面内部的细节层面,给Web开发者带来很大的便利. 我们先 ...

  2. 手机浏览器查看网页源码

    查看网页源码一直以为是pc端浏览器的功能,直到今天才直到手机浏览器也可以的,我用的是chrome手机浏览器,只需要在域前加view-source:即可. 比如:view-source:https:// ...

  3. 用手机怎么查看网页的源代码0

    1.首先在电脑上打开谷歌浏览器的右边的菜单. 2.在更多工具中找到"开发者工具". 3.接着会进入这个开发者的界面. 4.点击顶部的Toggle device toolbar按钮, ...

  4. 网页html语言怎么看,怎样查看网页的css代码?

    怎样查看网页的css代码?下面本篇文章给大家介绍一下.有一定的参考价值,有需要的朋友可以参考一下,希望对大家有所帮助. 怎样查看网页的css代码? 要查看一个网站使用了什么css代码,可以通过在网站空 ...

  5. 对着网页进行右键操作------审查元素(快速查看标签代码)

    之前做嵌入式也接触过浏览器, html,, css, js等东东, 但对前端的这些东东一直理解得不透彻, 最近搞了一下php, 作为服务端, php吧html串吐出来给浏览器显示, 玩了一些php代码 ...

  6. notepad++ 编写html代码快捷键切换到浏览器查看,notepad++在chrome浏览器中打开查看网页效果...

    notepad++在chrome浏览器中打开查看网页效果,操作设置:运行--在chrome浏览器中打开,这是notepad默认的设置方式 但是notepad++如果没有配置chrome浏览器打开,可以 ...

  7. HTML网页代码编辑格式

    ---恢复内容开始--- 1)贴图:<img src="图片地址"> 2)加入连接:<a href="所要连接的相关地址">写上你想写的 ...

  8. uc手机浏览器 手机模拟_网页为何总报浏览器漏洞?起底某些手机浏览器恶意推广行为...

    首先给互联网大厂说声抱歉,得罪时间又到了,这次到了参与纵容流氓推广的某手机浏览器.这篇文章照例归类到我的造作实验室专栏系列.PS:这篇文章为了等待投诉结果,特意晚了几个月才发. 事情起因 这事情还需要 ...

  9. pad看linux源码,在 iPad和 iPhone的浏览器上查看网页源代码

    今天使用iPad 处理OA上的问题,有个窗口不能正常工作,想查看一下源码,发现iPad中的 Safari和chrome 没有内置查看源码功能.查了几个资料,遇到的又是没抄全的,下面是safari的设置 ...

最新文章

  1. CSS里常见的块级元素和行内元素
  2. “ INSERT IGNORE”与“ INSERT…ON DUPLICATE KEY UPDATE”
  3. trackback (引用通告) 说明
  4. Ext4文件系统修复
  5. 【C++ STL学习之四】容器list深入学习
  6. 【转】查看linux服务器的系统信息
  7. python程序运行键_python实现按任意键继续执行程序
  8. solr6.6 导入索引数据
  9. 74系列标准逻辑集成芯片分类
  10. 校招行测笔试-图形推理
  11. H264三种码率控制方法(CBR, VBR, CVBR,)CRF和CQP
  12. yang模型中rpc_RPC原理篇
  13. 微信公众帐号第三方服务平台源码
  14. 毛桃pe系统 linux,老毛桃U盘PE重装教程
  15. C#爬虫 音娱吉他文本和弦谱
  16. Win10/Win11下清除windows defender安全中心病毒和威胁防护历史记录
  17. PPT之幻灯片中的大纲选项卡
  18. Java 计算任意两天之间相隔的天数
  19. catia孔深度符号标注_CATIA制图及工程图含图框详细教程(精编).doc
  20. Oracle数据库及安装

热门文章

  1. 搜索 —— 深搜的剪枝技巧
  2. 暑期训练日志----2018.8.12
  3. 最优布线问题(信息学奥赛一本通-T1349)
  4. 字符三角形(信息学奥赛一本通-T1004)
  5. div css网页设计源代码_HTML+CSS网页设计,企业网站服务项目布局样式
  6. 一起学习C语言:C语言基本语法(五)
  7. matlab遗传算法实例crtrp,遗传算法求解实例
  8. python turtle画五边形_python画一朵玫瑰给你
  9. 数据定义语言DDL之数据库操作
  10. 1.Hadoop的组成 HDFS YARN