IE css hack

IE6 Only
==================
_selector {...}

IE6 & IE7
==================
*html or { _property: }

IE7 Only
==================
*+html or { *property: } - Keep in mind that you have to put the IE7 property first within the same selector.

IE8
==================
.selector/*\**/ { color:#f00; }
**NOTE**: LESS v1.5.0 shoots out an error when compiling the CSS if you use this hack :/


IE8 and IE9 (TOTALLY NOT NEEDED - I LEFT HERE FOR REFERENCE ONLY)
==================
.selector { color:#f00\9; } - http://stackoverflow.com/questions/660652/ie8-css-selector

The above solution doesn't work with font-family, so instead you need to use "\0/ !important"
Example: { font-family:Arial \0/ !important; }            
http://dimox.net/personal-css-hacks-for-ie6-ie7-ie8/

Also, using "\9" is picked up by IE10 and IE11 so you need to redeclare the CSS rules with "-ms-high-contrast:". See info below.

IE9 Only
==================
:root .class/#id { property:value \0/IE9; }
**NOTE**: Prepos v4.0.1 shoots out an error when compiling the CSS if you use this hack :/
http://blog.vervestudios.co/blog/post/2011/05/13/IE9-Only-CSS-Hack.aspx
         
IE10 Only
==================
Method 1: UA Sniffing, which isn't the most loved method to target browsers, but here it is anyway.
http://css-tricks.com/ie-10-specific-styles/

Place this script in the <head>:
<script>
  var doc = document.documentElement;
  doc.setAttribute('data-useragent', navigator.userAgent);
</script>

Usage:
html[data-useragent*='MSIE 10.0'] .selector {...}

Method 2: It used 'Conditional compilation' which is not UA sniffing. Also, it excludes IE11 as well.
http://www.impressivewebs.com/ie10-css-hacks/
Conditional compilation: https://msdn.microsoft.com/en-us/library/8ka90k2e(v=vs.94).aspx

Place this script in the <head>:
<!--[if !IE]><!-->
<script>
  if (/*@cc_on!@*/false && document.documentMode === 10) {
    document.documentElement.className+=' ie10';
  }
</script>
<!--<![endif]-->

Note: Seems the Conditional Comment is not necessary, but I like to include it for good measure.

Usage:
.ie10 .selector {...}

== More info here: https://philipnewcomer.net/2014/04/target-internet-explorer-10-11-css/

IE10 and IE11
==================
@media screen and (-ms-high-contrast: active), (-ms-high-contrast: none) {
    .selector { property:value; }
}

https://gist.github.com/ricardozea/5549389

零js基礎 | 程序設計 | 16-html脚本编程

XDM核心方法是:postMessage('一个消息','此消息的来源域')
目的::向另一个地方传递数据
接收到XDM消息时,会触发window 对象的message 事件

data:作为postMessage()第一个参数传入的字符串数据
origin:发送消息的文档所在的域,例如"http://www.wrox.com"。
source:发送消息的文档的window 对象的代理。这个代理对象主要用于在发送上一条消息的窗口中调用postMessage()方法。如果发送消息的窗口来自同一个域,那这个对象就是window。

在onmessage 处理程序中检测消息来源可以确保传入的消息来自已知的页面。基本的检测模式如


    EventUtil.addHandler('window','message',function(event){
        if(event.origin == 'http://badiu.com'){
            processMessage(event.data)
            event.source.postMessage('Received!','http://p2p.baidu.com')
        }
    })

注:,event.source 大多数情况下只是window 对象的代理,并非实际的window 对象。换句话说,不能通过这个代理对象访问window 对象的其他任何信息。记住,只通过这个代理调用postMessage()就好,这个方法永远存在,永远可以调用

最好只传入字符串,如果要传入结构化数据,要先在传入数据中JSON.stringify();通过postMessage()传入得到的字符串,然
后再在onmessage 事件处理程序中调用JSON.parse()

拖放元素时,依次触发下列事件:

1、dragstart
2、drag
3、dragend

当某个元素被拖动到一个有效的放置目标上时,下列事件会依次发生:

1、dragenter
2、dragover
3、dragleave 或 drop

上述三个事件的目标都是作为放置目标的元素