zoukankan      html  css  js  c++  java
  • A small breaking change in IE8 causing big pain in the ass: the default type of button element

    The default type of button element is 'button' before IE8 (default means when you do not explicitly specify a value for the type property). However, in IE8, Microsoft decided to comply the w3c standard, thus the default type of button is changed to 'submit'. This costed me so much time that I started to hate w3 in a certain way.

    So you may ask, why?

    If the default button type is 'button',  the old Microsoft way of doing things, which is also what everybody will naturally think it should be, then clicking a button will only raise a click event, but if it is 'submit', it will cause the form in which the button resides to submit the form to server. This is big difference.

    If this breaking change only occurred in a different situation, it would not have costed me so much time. But, it emerged on a very complex page. The page lists the pictures the user has uploaded so far, but the pictures are all hosted from a different domain than the page's own domain. The page also lets user to upload new pictures and edit existing pictures' properties, but all to that resource server. So it is a very complex cross frame, cross domain page. When the breaking change was causing bug in the page,  the page's complexity lead me to the wrong dirrection when I was trying to resolve this bug. Thus it costed me a lot of time.

    So your guys watch out this breaking change of the default type of button element in IE8. Note chrome and firefox all have similar behavior as IE8.


    The discrepancy in browsers is a big pain for every web developers. So people like standard, but in the case of web developement world, there are two standards, the de facto standard, which is Microsoft's internet explorer, and the official standard, the w3c standard. So you have two standards to deal with. Now that for each web page, I have 5 browsers to have it tested with, the IE6,I E7, IE8, and chrome, firefox 4. I set up virtual machine for this.

    Btw there is a new virtual machine of IE9/Win7 from Microsoft to download.

  • 相关阅读:
    Maven版本问题导致的 unable to import maven project, see logs for details. 问题
    Java时间的转换
    idea中添加类和方法注释以及codeCheck
    使用Java语言递归删除目录下面产生的临时文件
    Oracle VirtualBox添加虚拟机
    java使用JMail通过QQ邮件服务器实现自动发送邮件
    linux下&、nohup与screen的比较
    InputStream流无法重复读取的解决办法
    使用Java POI来选择提取Word文档中的表格信息
    Java实现压缩文件与解压缩文件
  • 原文地址:https://www.cnblogs.com/kakrat/p/2071921.html
Copyright © 2011-2022 走看看