Explore IE8 JavaScript features beyond Imagination __ie

Source: Internet
Author: User

The improvement in CSS programming for IE 7 has created a refreshing sensation for many developers, but it's not flattering in Java script, and in fact, we're seeing some new bugs in this area. Fortunately, Microsoft has seen this, in IE 8, Java Script has become a focus of its development, below we will look at the developer point of view of some of the characteristics of IE 8.

W3c:queryselector

IE8 began to support some of the new queryselector and Queryselectorall two functions. Queryselector is a fast method to realize the search principle of CSS selector. IE 8 is the second browser that implements the selectors API (another browser is WebKit).

In simple terms, it's a stunning CSS selector feature in jquery. For example, the following example: (Only IE8 can run, FF, IE7 will have errors)

01
02
03
04 Innerspan
05
06
07 classspan
08
09
10

What needs to be highlighted here is that any selectors should be completely dependent on the native selector of the browser. IE8 supports CSS2.1, so developers no longer have to wait for the launch of CSS 3 selectors.

support for more HTML 5 features

I've always wanted to add some HTML 5 compatibility in IE 8, and in IE 8 we saw 4 complete features in this area, which is great.

1, HTML 5:window.location.hash

This feature has been very well supported by most browsers. The changes in Window.location.hash are used as navigation in IE8 Standard mode, and the URL of the previous document is saved to mimic the "back" button effect in an AJAX application. It has been modified in IE8 to broadcast this hashchanged time, and as far as I know this is the first browser to take this approach.

2. HTML 5:dom Storage

With this feature, data can be kept locally, replacing the original cookie storage mechanism. We have seen this feature in the Firefox browser after version 2.0, but this feature is not yet supported in opera and Safari.

3, HTML 5:postmessage

IE8 now supports cross file message communications (Cross-document MESSAGING-XDM). Through the OnMessage event and the PostMessage method, two Web pages from different domains can communicate.
Currently, ie 8, Opera 9, Firefox 3, and WebKit nightlies Editions support this feature, which means that the feature is almost supported by all the latest browsers.

4, HTML 5:offline Events
In IE 8, there are some offline events to detect the interruption of the network, through which we can write wonderful off-line Ajax applications. For now, browsers that support this feature include Firefox 3 and IE 8.

IE8 introduces Xdomainrequest cross-station data acquisition function

This is a very interesting feature for cross station data acquisition, but it does not work the same way as the Cross station XMLHttpRequest in Firefox 3. Its cross-domain domain is not unrestricted. The server side is required to return the HTTP header with xdomainrequestallowed=1 in order to cross the domain, otherwise it is unsuccessful.

XMLRequest cannot cross the station has been a multiple subdomain server mishap. So many situations have to consider the most original dynamic script and JSON way. However, the IE8 team is interested in solving the problem of Cross station access data, which is a IE8 progress.

In addition, the XMLHttpRequest in IE8 adds an important attribute timeout and OnTimeOut method, which is extremely important in optimizing the program.

dom Bug Patch

Getattribute/setattribute has made significant improvements in IE 8. Simply put, they can now do their own task, and the gap between IE8 and other browsers is small. The notorious accessing Relative/absolute HREF/SRC attribute problem has also been resolved, which is a great step forward. In addition, they also add hasattribute functionality.

Other additions and fixes include:
.ownerelement and. Ownerdocument. We now finally have a unified approach to dealing with the sub framework.
getElementById can return an object by ID. This is a function we have been looking forward to for a long time.
getattribute ("checked") now returns "Checked" instead of true.
• Dynamically created (or modified) radio buttons can now be selected.

I was happy and angry with the fixes, and I was happy that Microsoft had finally made the right changes to them, and it was angry that it took Microsoft so long to make the right changes.

The consortium: Events

This feature is a completely missing part of the current version of IE 8. We still need to continue to use IE's attachevent system, still can not see the arrival of AddEventListener. I'm not sure how much this loss of functionality will affect the ACID3 support for IE 8, but the AddEventListener test has been included in the ACID3, so Microsoft may have begun to consider increasing its support.

To some extent I can understand Microsoft's desire to keep its existing APIs, but I can't understand why they are not interested in adding support for AddEventListener. I guess the reason may be that Microsoft has to support concepts like event capture.

I am very disappointed about that. I think this is one of the areas that needs to be amended in the next release.

Java Script Language

The IE team has made some significant improvements in improving garbage collection, memory management, and performance, and these improvements are significant for the development of many of our applications.

Still, I have to correct a little. Although IE 8 is a great browser for Java Script Developers, it is probably just a "Java script+dom" developer, if more accurately said. In the case of Java script, IE 8 is rather disappointing: no new pure Java script features appear in this version of the browser. I can only hope to add more improvements in the next release.

Aria Support

This is a change that I am very satisfied with. Aria is a great specification for Web applications to be able to communicate clearly with readers. Prior to this, IE lacked support for it, but now this flaw has been made up in IE 8. Firefox, IE and Opera have all supported aria at the moment. It is incomprehensible that the WebKit team does not seem to be interested in supporting this function.

Embedded SVG

Currently, the support for embedded naming elements has been increased in IE 8. This means that you can make inline markup for SVG and methyl, and from this point of view, Internet Explorer is expected to increase native support for SVG in the future.

IE Web developer:ie version of the Firebug

In IE, we have finally seen this similar Firebug tool, in the words of Firebug founder Joe Hewitt: "I am very pleased that Microsoft has completely replicated Firebug functionality in IE8." "I have to admit that similar tools have been around for a long time and are well received by developers," he said.

IE Web Developer lets you examine and edit your HTML DOM, display error messages, log information, display site source code, monitor DHTML events, and HTTP traffic.

Browse mode Toggle

At first glance, because of this feature, you can see if your IE 7 Web page can be displayed in IE 8, but the real purpose is that developers can develop a standard compatible Web page (IE8, Firefox, Safari, and Opera), and then look at the display in IE 7. This is a very useful feature for developers, because we don't need to use other versions of IE in the virtual machine to test the effect of the Web page.

Bug Feedback

The IE team collects feedback from testers and then publishes the vulnerability to a publicly accessible web site. This is a very sensible step for Microsoft. This is where users can see Microsoft's improved information on vulnerabilities.

Conclusions

Overall, although IE 8 also has its own shortcomings, I still have a positive view of this new IE browser. Features like Queryselector, Aria, and PostMessage are very helpful to developers.

For those deficiencies, such as no new Java script functionality, no support for the CSS3, no selectors, I think there will be improvements in future releases.

If the Microsoft IE team can continue to go in the right direction, I think IE has left us no longer just disappointed.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.