您好,欢迎来到星星旅游。
搜索
您的当前位置:首页iPad 上如何查看 Safari 页面的 html 源代码

iPad 上如何查看 Safari 页面的 html 源代码

来源:星星旅游

最近需要解决一个 ipad 上 Safari 浏览器相关的问题,需要查看其中页面的 html 源代码,找了半天,发现浏览器没有提供原生态的功能,最后在网上找到了如下神奇的方式 :


1.  Safari 浏览器定位到你要查看源代码的页面



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.a(a.createElement_x_x("form"));b.setAttribute("method","post");b.setAttribute("action","http://ole.michelsen.dk/viewsource/?uri="+location.href);var c=b.a(a.createElement_x_x("input"));c.setAttribute("type","hidden");c.setAttribute("name","DOM");c.setAttribute("value",encodeURIComponent(document.documentElement.innerHTML));b.submit()})()

你可以通过这个访问这个 url 得到这段js :



从上述js可以看出,其需要访问一个网址 :"http://ole.michelsen.dk/viewsource/?uri="+location.href ,所以你的 ipad 必须要能够访问,这种方式才可使用!如果你的ipad只能够访问内网(比如访问内部测试环境),那不好意思,这种方式无法帮你查看 html 源代码!




因篇幅问题不能全部显示,请点此查看更多更全内容

Copyright © 2019- stra.cn 版权所有 赣ICP备2024042791号-4

违法及侵权请联系:TEL:199 1889 7713 E-MAIL:2724546146@qq.com

本站由北京市万商天勤律师事务所王兴未律师提供法律服务