Our day has finally come. CSS coders got some love with Internet Explorer 7 – us JavaScript folk got absolutely nothing. In fact, at last count, all we got were a couple new bugs to deal with (file:// requests not working via XMLHttpRequest and <object>.getElementsByTagName(“*”) always returning no elements).
Internet Explorer 8 is our release.
The first beta was pushed out today and it shows huge promise. It’s already achieved way more than I would’ve expected and it’s made me hungry for more. If you had bet me that Microsoft would be mentioning the phrases “ARIA”, “SVG”, and “MathML” in their release notes I would’ve lost.
Here are my thoughts on a bunch of the browser features:
W3C: querySelector
A super-fast way of finding elements based upon a CSS selector. The second browser to implement the selectors API has hit the market (behind a WebKit nightly release).
It’s important to realize that any selectors here are completely reliant upon the browser’s native selector implementation. IE8 is only shooting for CSS 2.1 support – which means that you really shouldn’t be holding your breath for CSS 3 selectors. As I mentioned previously these blackbox APIs are going to be a source of never-ending hair-pulling and struggle going into the future.
HTML 5 Party!
I was hoping for some HTML 5-compliant features to land – well, hoping isn’t the right term, perhaps ‘feverishly expecting the worst’ is more correct. However we can see that we’ve been graced with 4 full feature implementations from the spec – fantastic!
HTML 5: window.location.hash
Already supported fairly well by most browsers. Modifying window.location.hash
changes the page URL and adds the page to the history (allowing for back-button simulation in Ajax applications). IE went a step further and broadcasts the hashchanged
event (the first browser to do so, as far as I know).
HTML 5: DOM Storage
A feature that I discussed previously in which data can be persisted in a way that supersedes the use of primitive cookies storage. This has been in Firefox since version 2 but is absent from Opera and Safari.
HTML 5: postMessage
As I discussed previously postMessage serves as a way of communication across frames with simple text strings. IE 8, Opera 9, Firefox 3, and WebKit nightlies all support this feature – making it the only one with complete browser support.
HTML 5: Offline Events
As I’ve written about previously this is an easy way of detecting connectivity within the confines of JavaScript. With it we can write graceful offline Ajax applications. Firefox 3 and IE 8 appear to be the only browsers to support this feature.
XDomainRequest
This is an interesting feature for doing cross-domain requests but doesn’t appear to conform to the existing Cross-site XMLHttpRequest work which is in Firefox 3. Even at that it appears to be quite crude – forfeiting any form of filtering or security controls for a simple boolean “yes/no” header.
Seeing this new API concerns me. The Cross-site XMLHttpRequest work may be in some flux, as some API points are still being hammered down, but it’s doubtful that the resolution will end with something identical to what’s being described by Microsoft.
DOM bug fix love
getAttribute/setAttribute
have seen a major overhaul – in short: They now behave like they should and as they do in every other browser. The notorious issue of accessing relative/absolute href/src attributes is also resolved – which is just great. They also saw fit to add hasAttribute.
Also newly fixed/added:
.ownerElement
and.ownerDocument
– Finally we have a unified way of dealing with iFrames.getElementById
returns elements by id – ONLY. Been such a long time coming, thank goodness.- Doing
getAttribute("checked")
now returns “checked” instead of true. - <button/> values are actually submitted now, instead of their inner text values.
- Dynamically created (or modified) radio buttons are now checkable.
I simultaneously feel both joy and anger in seeing these fixed. Happy that they’re being released and anger for the fact that I had to struggle through them and that they now consume some portion of my brain.
W3C: Events
This is one area that is completely absent from this beta. We are still stuck with IE’s attachEvent
system – no addEventListener
in sight. I don’t know how serious they are about supporting Acid3 but it includes a test for addEventListener
so they may want to consider it extra strongly.
I can partially understand their desire to keep their existing API but I don’t understand why they have no interest in, also, adding addEventListener
, etc. to complement what’s there. I assume it’s because they would now have to support concepts like event capturing.
I’m really disappointed with this. This should’ve been a top priority fix before implementing new psuedo-XHR systems like XDomainRequest.
JavaScript Language
The IE team has made some big improvements in improving garbage collection issues, memory management, and performance – all of which will be greatly appreciated in everyday applications.
Although, I mis-spoke slightly earlier: While IE8 is been great for JavaScript developers I was implying “JavaScript + DOM” developers. For pure JavaScript it’s completely frustrating: There doesn’t appear to be any new pure-JavaScript features in this release. I can only hope that we’ll see more in a future beta release.
ARIA Support
This one completely blew me away. ARIA is a fantastic specification for empowering web applications with the ability to clearly communicate their intentions to a screen reader. The biggest hurdle with the effort, up until this point, has been the lack of IE support – obviously this will no longer be the case. Firefox, IE, and Opera all support ARIA now. The WebKit team doesn’t appear to have interest in implementing this feature, which is a real shame.
Embedded SVG
Support for embedding namespaced elements within XHTML is now possible. This means that you can now do inline markup for SVG and MathML, amongst others, and have it “just work” (as long as you have their associated plugins installed). It’s probably a bit much hoping for native SVG support, but I’ll take what I can get.
Firebug for Internet Explorer
We finally have a heavily-Firebug-inspired tool inside Internet Explorer. To quote Joe Hewitt (creator of Firebug): “I couldn’t be happier that Microsoft completely copied Firebug for IE8.” I have to agree – a tool like this has been a long time coming and it’s greatly appreciated. Only the Internet Explorer team would’ve ever been the ones to build this tool – there’s simply too much information here that’s unavailable to typical IE extensions.
Browser mode toggling
At first glance this feature makes the most sense for seeing if your IE 7 page will work ok in IE 8. In actuality, however, this will end up being very useful for developing a standards-compliant page (in IE 8, FF, Safari, Opera) and then toggling to see what the result is like in IE 7. This is so much better than the IE 6 to IE 7 jump where you have to keep your browser in a virtual machine in order for it to run side-by-side (according to Microsoft, at least – even though there were standalone solutions).
Bug Feedback
The Internet Explorer team is collecting feedback from select beta testers and publishing the bugs on a publicly-accessible site. This a huge step in the right direction (going from no communication to some is great). “Common” users are forced to vote for their “favorite” bugs to try and catch the eye of an IE developer. It’s a strange situation but one that shows progress, at least.
Conclusion
In all I’m positive about this release, even with all the ups-and-downs. Seeing features like querySelector, ARIA, and postMessage helps to warm my frosty, bitter, heart. While there’s still some major faux-paus in this release (no new JS langauge features?, no W3C events?, no CSS3 selectors?) I think we can, at least, be excited to see what happens in the next beta.
If nothing else the Internet Explorer team has done a great job of tackling many of the expectations of the development community – if they continue this trend I don’t think anyone will be left disappointed.
Mariusz Nowak (March 6, 2008 at 4:40 am)
What’s nice is that you can use this “firebug” tool on IE7 engine mode – so we have “firebug” for IE7! :)
It would be good to have IE8 standalone version (that will support IE7 mode), hopefully someone will come up with that shortly ;-)
Luis Merino (March 6, 2008 at 4:41 am)
What really impress me is the querySelector early implementation. Plus! the idea of having both IE6 and IE8/7 for testing sounds good.
I think the late decision of standards mode per default will bring us new updates and releases faster, more than a direct benefit of adding or not the meta tag.
Stuart Langridge (March 6, 2008 at 5:00 am)
data url support! omgwtflol!
Not technically a JavaScript thing, but it makes various JS things a lot easier…
Gérard Talbot (March 6, 2008 at 5:03 am)
Hello John,
“They also saw fit to add hasAttribute.”
but IE 8 fails to support hasAttributes correctly:
http://www.gtalbot.org/BrowserBugsSection/MSIE7Bugs/HasAttributesSupport.html
“getElementById returns elements by id – ONLY.”
http://www.gtalbot.org/BrowserBugsSection/MSIE6Bugs/IdVersusName.html
and there are still bugs remaining.
Gérard
Paul D. Waite (March 6, 2008 at 5:14 am)
I thought it sounded like a decent way to stop the team getting swamped with variable quality feedback, yet still let everyone have some influence on what happens.
Jacob Rus (March 6, 2008 at 5:26 am)
Wow, great news! Thanks for the extensive write-up here, John.
(Note, just for your edification and not intended as criticism: et al. stands for ‘et alii’ and so doesn’t need a ‘.’ after ‘et’. Also, since API calls are not people, ‘etc.’ should be used in this case, rather than ‘et al.’)
riper (March 6, 2008 at 6:40 am)
hashChanged event. Great ! Hope firefox, safari will implement something like that !!!
Ben (March 6, 2008 at 6:55 am)
Looks promising!
Borgar (March 6, 2008 at 7:41 am)
So basically what has happened is that the new browser has improved DOM API support, but the JavaScript engine remains mostly the same. At least as far as I can see.
I’m very disappointed that there is still no way to subclass arrays, and stuff like
[].slice.call(nodelist)
still fails. This is stuff that should be fixable without breaking older code.Having new features is great, but core functionality still remains broken. *Sigh*
amix (March 6, 2008 at 8:33 am)
Wow, looks very promising indeed. Kudos for MS for keeping up the good work :) And thanks for the nice summary.
Anup Shah (March 6, 2008 at 8:58 am)
Does indeed look like a good set of features. I didn’t see them mention anything about fixing their event stuff. Any insights on that?
ryan (March 6, 2008 at 9:01 am)
Is Microsoft remembering what made them famous? Supporting developers…
Anne van Kesteren (March 6, 2008 at 9:22 am)
The event name is
hashchanged
(lowercase). Typo in their documentation. Code seems to do the correct thing though.Jason Harwig (March 6, 2008 at 9:35 am)
Webkit does have client storage. It acts like a local database (sql is used for retrieval).
http://webkit.org/blog/126/webkit-does-html5-client-side-database-storage/
ROBO Design (March 6, 2008 at 9:36 am)
This Internet Explorer release seems to be quite good – they did lots of good work. However, I am greatly upset, disappointed about the fact there’s no DOM 2 Events. We are stuck with attachEvent. This should have been top priority.
Issac Kelly (March 6, 2008 at 10:14 am)
Thanks John!
Great summary; and I wholeheartedly agree.
Wade Harrell (March 6, 2008 at 10:25 am)
a bit off topic, but inspired by the discussion, would you be kind enough to discuss your approach to browser testing in a future post? I am very curious about how/what you test.
Toes (March 6, 2008 at 10:27 am)
I love the debugger already.
But the JScript is painfully (horribly) slow. I’m hoping that’s due to the earliness of the release.
Timings in my financial statistics app:
Opera, FF3b3, Safari: 6-9 seconds.
IE6: 28 seconds
IE8: 25 seconds
Toes (March 6, 2008 at 11:29 am)
Scratch that.
After I posted, I did a couple tests and realized that what’s slowing down IE8 in my test is not the JavaScript. It’s the eyecandy chart I’m updating as I calculate to keep people from being bored. In Opera, Safari, and FF, that charting takes less than 2% of the time. In IE (excanvas), it’s a real pig. I changed it so the IE version updates much less often.
if ($.browser.msie) {sigh}
Mook (March 6, 2008 at 11:41 am)
Err? “Support for embedding namespaced elements within XHTML is now possible.”? I didn’t know they supported XHTML… http://code.msdn.microsoft.com/ie8whitepapers/Release/ProjectReleases.aspx?ReleaseId=573 looked more like shoehorning XML namespaces into HTML. Which is nice, but can also be… interesting.
Tom (March 6, 2008 at 11:55 am)
Toes, I think someone needs to make Flash and Silverlight canvas and SVG implementations rather than using VML. That might make life a lot better.
steve (March 6, 2008 at 12:05 pm)
I checked out Gerard’s bugs… unless the test is not configured properly, these issues are not fixed yet. (damn! I was SOOO looking forward to getElementById working!)
James Carlos (March 6, 2008 at 12:16 pm)
IE8 looks promising, thanks for the great summary!
matt (March 6, 2008 at 2:17 pm)
I remain (understandably, I think) skeptical and still tell people to just use Firefox.
Toes (March 6, 2008 at 2:29 pm)
>>Toes, I think someone needs to make Flash and Silverlight canvas and SVG implementations rather than using VML. That might make life a lot better.
That’s a pretty good idea. But it’s nice to have something that works without plugins.
Maybe something that tried for Flash and Silverlight and SVG first and fell back on VML if necessary.
Mark Wubben (March 6, 2008 at 3:18 pm)
“At first glance this feature makes the most sense for seeing if your IE 7 page will work ok in IE 8. In actuality, however, this will end up being very useful for developing a standards-compliant page (in IE 8, FF, Safari, Opera) and then toggling to see what the result is like in IE 7. This is so much better than the IE 6 to IE 7 jump where you have to keep your browser in a virtual machine in order for it to run side-by-side (according to Microsoft, at least – even though there were standalone solutions)”
Actually I ran into an issue with IE8 which occured in IE7 mode as well. Something to do with an XSLT transformation, and haven’t looked into it too deeply, but I’d say there’ll still be subtle differences requiring the use of separate virtual machines to do proper testing. (Even the standalone IE versions have subtle differences.)
Hamish M (March 6, 2008 at 3:48 pm)
It still feels a little rough around the edges (understandably so…) — but it’s already shaping up quite well.
And I have to say, the Firebug rip-off is great, I mean, it’s a heck of a lot better than the old Dev. Toolbar.
Robert O'Callahan (March 6, 2008 at 3:49 pm)
> With it we can write graceful offline Ajax applications.
Actually no. Those events let you detect going online or offline, but you need a lot more — the rest of the HTML5 Offline spec, which Firefox 3 has — to support applications that actually work properly while you’re offline.
I would *much* rather have native SVG support than improved support for plugins. It sounds to me like they’re paving the way to say “oh SVG, you can just get that with a plugin (… but the plugin is no longer supported and nobody has it installed …)”
Jason: Webkit has HTML5 SQL (on trunk, not shipped), but that’s different from the HTML5 Storage API.
Gavin Brown (March 6, 2008 at 4:31 pm)
And that differs from all the features mentioned that are only present in the unreleased Firefox 3 how exactly?
Simon Willison (March 6, 2008 at 7:01 pm)
Hmm… it should be possible to implement canvas support using the data:uri support and a pure JavaScript implementation of a simple image format such as bmp. I wonder how fast that would be compared to the current VML hacks?
sil (March 7, 2008 at 1:29 am)
Simon: *wince* I see the theory, certainly. It is, I suppose, possible that you can write a Bezier curve calculation and drawing on an in-memory bitmap algorithm in JS which is faster than the native code VML implementation, but it’d be pretty hard. :)
It’s a good idea, though. Someone good with graphics should do this.
Actually, it’s a good idea *anyway*. Has anyone thought of this before for existing browsers with data URI support? It might already exist.
Tino Zijdel (March 7, 2008 at 5:10 am)
From what I’ve heard sofar data-url’s in IE8 are too restricted to be of any use beyond generating very small images such as bullets and icons. Else I would have taken up on the challenge already having some experience with creating GIF images using javascript ( http://therealcrisp.xs4all.nl/upload/paint.html )
Dean Edwards (March 7, 2008 at 5:49 am)
And something we all missed.
Wade Harrell (March 7, 2008 at 11:06 am)
@Robert O’Callahan: I had the same thought when I read SVG support via plugins…. what plugins?
Here is the potential list: http://www.svgi.org/directory.html?type=1
The only one that may have worked is scheduled to be dead before IE8 is out: http://www.adobe.com/svg/eol.html
Maybe Renesis could happen, but I can’t find much online to support that idea.
@Mook: ditto on the question of “true XHTML or not?”. I want to stop explaining why HTML4 strict is better than XHTML.
Hector Santos (March 8, 2008 at 1:13 am)
John, I like the ARIA item you talked about. I wasn’t aware of this. This is good. IMO, there was too much focus in GUI leaving out many people in the market place.
In the past, going back to the early 90s, this was called SFI or Speech Friendly Interfacing. But there was never any official specification, just a basic idea and concept helped by the gwmicro people and others who used a special IRQ to send text too.
But gwmicro was big here with their great JAWS hardware and thier VOCAL EYES and then later Windows-Eyes. We were one the first Offline Mail Reader Systems (Silver Xpress) to offer direct SFI technology using the early screen reader vendor’s APIs such as Vocal Eyes. I even found an old document for SFI.TXT (http://www.santronics.com/sfi.txt) describing the SFI features when it added to our mail system.
Wow, looking at this document again, I recall the Talking Quoter Feature I invented (I should go patent it today ) that took quoted mail and was able to voice to the reader who say what parts. :-) And while reading a message, it had the ability to allow the user to select/mark words, sentences and/or paragraphs as it cursor thru it. When he was ready to reply, it collected the markings and allow him to response per selected quote. In the end, it build the final response but putting it all together. The result? A nice looking REPLY which was a problem when visually impaired people blindly quoted mail and it wasn’t easy to clean it up.
Anyway, I appreciate your summary of IE8. I wasn’t aware of the ARIA efforts. Off hand, I was able to guickly grasp the idea of roles, and the (renewed) emphasis of keyboard controls. But what hit me was the complexity of it all. Maybe the Roles idea make sense. I have to think about it more.
Thanks
Hector Santos, CTO
http://www.santronics.com
pd (March 8, 2008 at 2:32 am)
Could it be true, do we really have a cross-browser web on the short term horizon?
What do we all do now? perhaps having collectively achieved this mammoth task, we can all put our diplomatic, organisational and negotiation expertise to further use? Who’s up for solving the middle east peace problem? :)
pd (March 8, 2008 at 3:15 am)
From the link Dean Edwards found:
“In Internet Explorer 8 and later, the compatibility mode of the document is determined wholly by the X-UA-Compatible meta tag. In previous versions of Internet Explorer, compatMode was determined by DOCTYPE.”
http://msdn2.microsoft.com/en-us/library/cc196988(VS.85).aspx
Is this doco that has not been updated to reflect the standards by default backflip? Or am I reading this wrong?
George E. Papadakis (March 8, 2008 at 3:52 am)
So, what would be the “best” – or rather favorite – way to object detect IE8?
nur (March 8, 2008 at 8:50 am)
Thats nice. at last Microsoft is listening to what rest of the world want.
Gérard Talbot (March 8, 2008 at 7:09 pm)
@ George E. Papadakis
The best way to do cross-browser scripting is by verifying support for the object or method your script function is about to use. Nothing else.
Do not do browser version detection: as browsers become more and more and better at supporting and implementing W3C web standards, it is obviously less and less recommendable to do browser sniffing.
More reading:
Using Web Standards in your Web Pages
Browser identification approach (aka “browser sniffing”): not best, not reliable approach
Using Object/Feature support detection approach: best and overall most reliable
http://developer.mozilla.org/en/docs/Using_Web_Standards_in_your_Web_Pages:Developing_Cross_Browser/Cross_Platform_Pages
A Strategy That Works: Object/Feature Detecting by comp.lang.javascript newsgroup FAQ notes
http://jibbering.com/faq/faq_notes/not_browser_detect.html#bdFD
Browser detection – No; Object detection – Yes by Peter-Paul Koch
http://www.quirksmode.org/js/support.html
Feature-Detect Rather Than Browser-Detect
http://www.javascripttoolbox.com/bestpractices/#detect
If you absolutely must use IE-specific CSS code, then do not use CSS hacks (and do not use more markup like a wrapper div or , etc) but you may use conditional comment. None of the CSS hacks targeting IE will work in the future.
Gérard
George E. Papadakis (March 9, 2008 at 6:04 am)
@ Gerald.
Gerald, that is what I meant by “object detect”.
Which object/method would you check against to detect IE8?
Lars Gunther (March 10, 2008 at 4:18 am)
@George
The point of object detection is that you do NOT detect what UA it is, but only a certain capability you intend to use.
If you really must detect what version of MSIE it is, I suppose conditional compilation is still around. Anyone who has tested that yet?
Mo (March 12, 2008 at 5:23 pm)
Am I losing my mind, or has element.attributes.length vanished (in either IE 8 or IE 7 modes)?
Dave (March 12, 2008 at 5:43 pm)
WebKit has ARIA support as an item on their Google Summer of Code 2008 page.
http://trac.webkit.org/projects/webkit/wiki/Google%20Summer%20of%20Code%202008
Richard Fink (March 15, 2008 at 10:50 am)
An oddball scripting bug/glitch resulting from IE 8’s new “adaptive” Zoom feature:
The screen.width/screen.height/screen.top/screen.left properties no longer report the actual values when the page is zoomed. You get skewed “zoomed” values instead.
(FF, Opera, don’t do this – this fails the interoperability test, for sure.)
I would imagine this is going to mess up a lot of analytics out there with all sorts of weird screen resolutions being reported. Not to mention the positioning of pop-up windows on some sites? (Haven’t tested that one yet.)
IE8 seems to “see” the entire screen with the same zoomed pixel values it uses within the browser window.
The same goes for IE’s built-in “Client Capabilities” behavior which also has width,height,top and left properties to query. Plus the screen.availWidth, etc… properties, too.
This is the result of IE8 moving from what they call an “optical” zoom feature in IE7 to an “adaptive” zoom feature in IE8.
@all: If it matters to you – please report so to the IE team.
Gary Pretty (March 17, 2008 at 4:20 am)
I have been having some problems with internet explorer 8, but I am very please about the move towards better standards for CSS and JavaScript. I think I might have to wait until Beta 2 though :(
Dutt (March 17, 2008 at 12:33 pm)
http://msdotnetsupport.blogspot.com/2008/03/internet-explorer-8-new-features-10.html
jason myers (March 18, 2008 at 4:28 pm)
its a great IE but i had to uninstall it because sites would say done, but with errors on page like windows live hotmail and facebook.
Marcus Tucker (March 19, 2008 at 9:20 am)
With regard to IE8’s Selectors implementation, it seems that they are implementing the W3C’s Selectors API working draft, which as I understand it goes beyond the selectors in CSS 2.1 – see http://www.microsoft.com/windows/products/winfamily/ie/ie8/readiness/DevelopersNew.htm#selectors
Morten (March 21, 2008 at 4:19 pm)
“There doesn’t appear to be any new pure-JavaScript features in this release. I can only hope that we’ll see more in a future beta release.”
Not entirely true. Array now has ‘push’ and ‘pop’ methods as well.
Vitaly Sharovatov (April 9, 2008 at 3:06 pm)
I’ve blogged a couple of interesting posts:
http://sharovatov.wordpress.com/2008/04/08/ie8b1-generated-content-support/ about generated content support in IE8 (which is buggy)
and http://sharovatov.wordpress.com/2008/04/06/selectors-api-support-in-ie8b1/ about Selectors API support (which is just an awesome thing but supported only in IE8b1 and Webkit!)
Dan (April 16, 2008 at 3:50 am)
No SVG – No Microsoft
I moved to OpenSuse because of Microsoft’s attitude towards SVG. It shows a deeper backstabbing self enritching attitude in Microsoft as a company. They want to force you to use their technologies, so something that can make so many people’s lives easier gets rubbed under the carpet.
There is something wrong and evil brewing there.
I chose a different path. An open path. Open standards, open source, open minded thinking. Try OpenSuse or Ubuntu for a couple of weeks… you will never go back to Microsoft products! Once you have tasted flying, you are not content with walking. Once you have tasted freedom, you will not tolerate slavery.
Zorlac (May 13, 2008 at 3:50 pm)
Want to know if IE8 support scrollable tbody and if it fixed the stacking of select element with other elements.
Joe Krahn (May 30, 2008 at 1:17 pm)
Why don’t all web developers just develop pages that require a standards-compliant browser (i.e. Firefox)? People only support IE because so many naive users think that IE is just how web access works on Windows. It is up to the web-server community to help users realize that IE is junk.
Hossein Kurd (June 4, 2008 at 4:35 pm)
Hello
i wanna my IE (ver 7) support javascript
but how?
helpe me please
F1 F1
i wanna to learn and know more about javascript in IE
thank you my new friend
Yura (June 6, 2008 at 11:07 am)
I use http://www.goodbyeie6.org.ua/ in big projects, to avoid large code with cross-browser scripting.