zoukankan      html  css  js  c++  java
  • 如何在ios手机端的Safari浏览器 中“查看网页源代码”

    在这里给大家分享一个很简单的用苹果手机无需越狱就可以查看网页源代码的方法,不过这个方法只用于苹果手机自带的Safari浏览器

    随便添加一个safari 书签 (用于一会改为查看源码功能书签)进入书签 点击编辑 后选择第一步好的书签。更改书签 标题 随意(我改成查看源代码简单明了- -),下面网址改成

    javascript:(function(){var w=window.open("about:blank"),d=w.document;d.write("<!DOCTYPE html><html><head><title>Loading Source</title></head><body></body></html>"),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();})()

    现在,当你想要查看某个网页的源代码时,打开书签菜单并点选“查看源代码”,就能查看经过语法高亮处理以及链接可点处理的源代码了。

    需要注意的是,这里的 JavaScript 会把当前页面发送到 michelsen.dk 服务器进行处理,如果对这一点不放心则可以考虑其他查看方法,不过目前 michelsen.dk 的语法高亮功能确实很棒。

  • 相关阅读:
    Sprinig.net 双向绑定 Bidirectional data binding and data model management 和 UpdatePanel
    Memcached是什么
    Spring.net 网络示例 codeproject
    jquery.modalbox.show 插件
    UVA 639 Don't Get Rooked
    UVA 539 The Settlers of Catan
    UVA 301 Transportation
    UVA 331 Mapping the Swaps
    UVA 216 Getting in Line
    UVA 10344 23 out of 5
  • 原文地址:https://www.cnblogs.com/liuyanxia/p/5378741.html
Copyright © 2011-2022 走看看