In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
Today, the editor will share with you the relevant knowledge points of Java's FE hidden rules, which are detailed and logical. I believe most people still know too much about this knowledge, so share this article for your reference. I hope you can get something after reading this article. Let's take a look at it.
1 first of all, the simplest select tag, there are many incompatibilities:
A, cloneNode method, there is no problem for non-IE browsers, for IE browsers, the problems I encounter include:
1) the option selected will not clone, and then it will use * option as the selected value
2) there will be problems with the event clone
B, Readonly: for IE6, you can set select to readonly in the following ways:
Obj.onbeforeactive=function () {return false}
Obj.onfocus=function () {obj.blur ();}
Obj.onmouseover=function () {obj.setCapture ();}
Obj.onmouseout=function () {obj.releaseCapture ();}
For other browsers, I use element substitution, dynamically creating an input tag, assigning a value to it, and then hiding the select.
C, select's z-index is not valid for IE6. There is a lot of discussion about this on the Internet, and jQuery uses an iframe to fix it.
D. The method of dynamically adding option is different. There are a lot of searches on the Internet.
E, the response to onclick and onchange is different. Under FF, you can dynamically read the option value during onclick select and then build option, and then select a value and execute the onchange event, but you cannot do so under IE.
2 css has a different understanding of offsetWidth and the like.
Http://newleague.iteye.com/blog/765535
3The understanding of vertical-align baseline is different:
Http://w3help.org/zh-cn/causes/RD1016
4 set the background color
Element.style.backgroundColor
If you want to change the color under firefox, you must first set it to null, and then set it to another color, that is, cancel the original color first.
Under IE, if you want to cancel the color, you must set it to'', and if you change to other colors, you don't need to remove the previous color first, but if you set it to null, it won't work.
5 different browsers have different understanding of padding
6 different browsers have different understandings of forced line wrapping and non-line wrapping:
The most disgusting thing is that for IE6, if I am a mosquito, then writing word-break:keep-all on td is still invalid, and must also be written on span.
7 different ways to get head nodes
Window.head can be used under Firefox, and the compatible way for all browsers is document.getElementsByTagName ('head') [0]
8 the method of adding css code to head is different, that is, adding tags dynamically.
Under IE, you can use var style=document.createStyleSheet (); style.cssText=cssCode
According to an article, on IE on Windows, the styleSheet of styleElement is returned with createStyleSheet, and styleElement itself is returned on Mac.
Document.createElement ('style') is required under other browsers
Then there is the distinction between having the styleSheet attribute or not.
This is easy to find.
9 for onchange events, firefox browsers can register on components such as table,div, and then intercept events emitted by input,select through bubbling, while IE cannot, it must be bound to the corresponding components
10 if input is set to readonly=true, it will still respond to keypress,keyup,keydown,onblur events
11 IE and non-IE have different ways to stop bubbling and cancel default behavior
12 everyone knows that IE and non-IE use different methods when adding events dynamically, IE is attachEvent, the other is addListener, and then the parameters are also different. More importantly, if a control binds multiple function, their binding and execution order is different, the IE is the opposite of the binding order, and the other is the same as the binding order.
13 to get the current event is different, one is window.event and the other is to accept event directly
The execution of offset series under 14 FF is very slow, but it is faster under IE, and the implementation of IE change CSS is very slow.
Firefox6 is much faster than Firefox3.6, with a difference of several hundred times (JS processing for a table with 400 rows and 50 columns)
15 if a large number of dynamic changes to the css, then use document.createDocumentFragment, and then need to modify the style of the Dom to get appendChild to this temporary fragment, modify the css and then append back, so the performance can be hundreds of times worse.
When the browser loads the web page, the html is read sequentially, and the external js link will be read in, and then executed sequentially, while interpreting and executing, while for the external css, the picture is started to connect to the server to get it.
IE has restrictions on the introduction of CSS. I haven't tried it, but there is an article that discusses: http://blog.csdn.net/ydshang/article/details/4158211
17 A table can locate a row by changing the scrollTop, of course, if a scroll bar appears.
Remember to release the 18 IE Dom after you use it. You can use the unload method, otherwise there will be a memory leak.
The 19 unload method varies from browser to browser, which I introduced in my previous article. Http://sslaowan.iteye.com/blog/1128209
20 I know why FE's favorite browser is FF, the most annoying is IE6, I wish IE6 would die, and other IE are not so good. But Chrome,Opera also has its own bug.
21 Ajax when using synchronous mode, if you visit the wrong link, FF will report an error on the console, and IE will pop up a dialog box and crash.
22 FF supports document.getElementsByClass and other methods, but IE does not, so you can write one yourself.
23 the trim method is different under IE and FF. You need to write one yourself, and you can use regular expressions.
24 the css class of dynamic setting elements is also different in IE and non-IE browsers
Sometimes the local font library will affect your font, size and other display, but sometimes it will even affect your layout
26 strings can also be used >
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.