怪癖或没有怪癖的书签

news/2024/7/10 1:40:04 标签: js, javascript, java, html, vue
htmledit_views">

Here's a bookmarklet that will tell you whether or not the browser renders your page in Standards Complaiance Mode or Quirks Mode. The bookmarklet will figure this out for the page as well as for all the frames (and their frames) recursively. Enjoy!

这是一个书签,可以告诉您浏览器是否以“标准兼容模式”或“怪癖模式”呈现您的页面。 小书签将以递归方式在页面以及所有框架(及其框架)中解决该问题。 请享用!

安装 (Install)

Drag this to your bookmarklets/favorites or right click and add to favorites:

将此拖到您的书签/收藏夹中,或右键单击并添加到收藏夹:

quirks or !quirks 怪癖或!怪癖

样品输出(Sample output)

quirks.png

As you can see the page has two frames (probably iframes, doesn't matter), one of them is rendered in Standards Compliant Mode (CSS1Compat) the other one is in Quirks Mode (BackCompat). The overall document is CSS1Compat as well. For the frames, if they were named, you would see the name of the frame before the URL brackets.

如您所见,页面有两个框架(可能是iframe,这无关紧要),其中一个框架是在标准兼容模式(CSS1Compat)中呈现的,另一框架是在怪癖模式(BackCompat)中呈现的。 整个文档也是CSS1Compat。 对于框架,如果已命名,则将在URL括号之前看到框架的名称。

quircks-gmail.png

代码 (The code)

The code is pretty simple, just accessing the compatMode of the the document object. Here it is in more human readable form (not one long line like bookmarket code).

该代码非常简单,只需访问document对象的compatMode即可。 在这里,它以更易读的形式出现(不是像书市代码那样的长行)。

var response = 'Document mode: ' + document.compatMode;
function checkFrames(w) {
  if(w.frames && w.frames.length>0){
    response+='\\n\\n';
    for(var i=0;i<w.frames.length;i++){
      var fr=w.frames[i];
      try {
        response+=fr.name +
              ' ('+fr.document.location+') - '+
              fr.document.compatMode+'\\n';
      } catch (e) {
        response+='Could not access this frame\\n';
      }
      checkFrames(fr);
    }
  }
}
checkFrames(window);
alert(response);

Tell your friends about this post on Facebook and Twitter

在Facebook和Twitter上告诉您的朋友有关此帖子的信息

翻译自: https://www.phpied.com/quirks-bookmarklet/


http://www.niftyadmin.cn/n/1306641.html

相关文章

PHP的乐趣

I remember reading a discussion over at Sitepoint - has the fun gone out of PHP? No it isnt! No way, the fun is here... or should I say PHun &#x1f609; 我记得在Sitepoint上阅读过讨论-PHP带来的乐趣了吗&#xff1f; 不&#xff0c;不是&#xff01; 没办法&am…

java 前后的区别_混淆前后的区别

源码publicclassPhoneActivityextendsActivity {private EditText dt_number null;Overridepublic void onCreate(Bundle savedInstanceState) {super.onCreate(savedInstanceState);setContentView(R.layout.main);//加载指定的布局Button bt_dail (Button) findViewById(R.…

FusionCharts使用问题及解决方法(一)-FusionCharts常见问题大全

FusionCharts使用问题及解决方法(一) 如果你无法看到任何图表&#xff1a; 如果浏览器中的进度条一直加载&#xff0c;或者右键菜单显示 "Movie not loaded"&#xff0c;请检查下列内容&#xff1a; 1、是否已将SWF图表和JavaScript文件(FusionCharts.js, FusionCh…

java如何实现udp连接_Java 实现Socket,和UDP连接的一个样例

【socket】import java.io.DataInputStream;import java.io.DataOutputStream;import java.io.IOException;import java.io.InputStream;import java.io.OutputStream;import java.net.ServerSocket;import java.net.Socket;import java.net.UnknownHostException;public class…

dreamhost 好用吗_在Dreamhost上安装ExifTool

dreamhost 好用吗ExifTool looks like a very promising tool to fiddle with all sorts of JPEG metadata (needed for smush.it) but first I had to make sure I can install it on Dreamhost. Although installation didnt go as described on the exiftool site (since I …

FusionCharts使用问题及解决方法(二)-FusionCharts常见问题大全

FusionCharts使用问题及解决方法(二) 如何启用JavaScript调试模式&#xff1f; 要启用JavaScript调试模式&#xff0c;你将需要写下面的几行代码&#xff1a; FusionCharts.debugMode.enabled(true); 此外&#xff0c;你还需要指定"debugMode" 输出的位置。如果你…

mdb使用_使用MDB2进行性能调优

mdb使用This is a follow-up to Lars comment about the PEAR book. In the MDB2 chapter I showed an example how you can create custom debug handlers in MDB2 and then gave a suggestion about a useful application of this functionality for performance tuning. Bas…

mac 10.13 安装 java7_【精华】MacOS 10.13.2 环境下安装eclipse

一、安装jdk下载jdk安装包 我下的是1.8 在这个甲骨文官网上下载网址&#xff1a; http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html(安装Eclipse前先确认你的Mac上是否已安装java运行环境。进入终端&#xff0c;输入”java -version”&a…