Partilhar via


IE8 AJAX Navigation

Hi, I’m Sharath Udupa, developer on the IE team focusing on AJAX features for IE8. One of the AJAX improvements we adopted in IE8 from HTML5 is AJAX page navigations. In IE8 mode, we provide support for script to update the travel log components (for e.g. back/forward buttons, address bar) to reflect client-side updates to documents. This allows a better user experience where users can navigate back and forth without messing the AJAX application state.

For more information regarding the feature and sample code, refer to the Internet Explorer MIX08 Hands-on Labs for AJAX and IE8 Beta 1 for Developers. For an example of how this can be used to hook navigation in Silverlight (with sample code!), see Michael Scherotter’s blog  posts titled How IE8 Enables Silverlight Deep Linking and Browser Back/Forward Navigation and IE8 Forward/Back in a Silverlight 2 (Beta 2) Application for further details.

Sharath Udupa
Internet Explorer Developer

Comments

  • Anonymous
    July 14, 2008
    PingBack from http://blog.a-foton.ru/2008/07/ie8-ajax-navigation/

  • Anonymous
    July 14, 2008
    Can you please post a direct link (not a link to a zip file of 25 random files) that includes the documentation on how to "set" and "get" a position in history? This is all we need, in a simple HTML document. e.g. MSDN.

  • Anonymous
    July 14, 2008
    The comment has been removed

  • Anonymous
    July 14, 2008
    @tony are the relevant bits correct? these are samples to show a technique - all of it doesn't need to be perfect.

  • Anonymous
    July 14, 2008
    The comment has been removed

  • Anonymous
    July 14, 2008
    The comment has been removed

  • Anonymous
    July 14, 2008
    The comment has been removed

  • Anonymous
    July 14, 2008
    The comment has been removed

  • Anonymous
    July 14, 2008
    I think this will be one of the greatest features introduced in a long time! In example my website would benefit greatly from it... http://www.jabcreations.com/blog/?prompt=options-basic Now if we could just get some addEventListener support (which is supported in Gecko 1.8, Opera 9.0, and Safari 3.0+) IE would be reasonably tolerable... http://www.jabcreations.com/blog/?prompt=themes-editor

  • Anonymous
    July 14, 2008
    The comment has been removed

  • Anonymous
    July 14, 2008
    @Steven Lets rephrase it then.  If a person was looking for a job and they came to you with this as an example of their code would you even consider them for a position as a developer? In most offices I know this code would secure you a position at the bottom of the "paper for recycling" pile.

  • Anonymous
    July 14, 2008
    Hey Now, Great Post, I'd really like to see how spacial navigcation in browsers will be implemented. Such as using hte arrow keys now tab & shift tab to areas of focus. Thx 4 the info, Catto

  • Anonymous
    July 14, 2008
    any of you fools whining about sample code stop to think that mayb the ie guyz have better things to do with thier time then write up html?  like, maybe, finishing the browzer? if thier company is anything like ours, they made some poor english major write the help anyway.

  • Anonymous
    July 14, 2008
    The comment has been removed

  • Anonymous
    July 14, 2008
    Great work. I'd really like to see how spacial navigcation in browsers will be implemented.

  • Anonymous
    July 14, 2008
    So the only new thing here is the hashChanged event, right?

  • Anonymous
    July 15, 2008
    @Ted: when you publish something, you try and make sure it is readable, right? That's the point in publishing. I mean, even private documentation requires a bit of polishing to stay readable Thus, it would stand to reason to think that documentation that is open for everyone to see would be at least a bit... licked. Instead of that, we get what would pass off as 'tag soup', plain and simple. How would you like one of your developers, or even better, one of your software providers, dumping a set of annotated, damaged, incomplete and unordered printout folders when you ask them for their software documentation? When you give out sample code, you do it right - that means, clean, consistent, complete code that doesn't hit this or that well-known browser bug or mis-implementation. And right now, that actually means XHTML 1.0 Strict Annex C code, or HTML 4.01 Strict following "best practice" coding - meaning, closing your tags (the IE table-as-inline-element bug is avoided here), code in lower case for tags, attributes and values (avoid getElementById etc. case sensitivity - or lack thereof in IE - if everything is lower case), logical tag hierarchy (valid code structure), and separated style. Or, you can keep creating tag soup, encourage others to do the same, and look surprised when you boss asks you why the site he asked you to make blows up on a browser update.

  • Anonymous
    July 15, 2008
    when are we going to see better canvas object support

  • Anonymous
    July 15, 2008
    Mitch-- Haha... real companies don't waste valuable win32 developers writing html samples.  they've got better things to do.

  • Anonymous
    July 15, 2008
    That´s is good thing for Ajax developers, but we need write more and more codes, for build a good web application. Some times, i preffer a old client script application for somethings. Bye!

  • Anonymous
    July 15, 2008
    Ted: don't delude yourself, there is simply no excuse for this. Microsoft wants us to believe they care about standards now, telling webmasters to fix their site for IE8 and all that, yet still do the opposite of what they preach.

  • Anonymous
    July 15, 2008
    Don't forget that you still haven't achieved the expected standards support even in IE8 and that ppl expect you to be fully standards compliant (99%+) or very very close to competing browsers by IE9 (SVG, XHTML, DOM3, CSS3, APNG etc everything). Meanwhile, keep looking at http://blog.seanalexander.com/content/binary/ApplesMobileMedoesntfullysupportpopularb_3CBD/Capture.jpg once in a while to remain motivated.

  • Anonymous
    July 15, 2008
    @Ted,Mitch and all others on the code quality thread (including the Epic Fail post that got deleted) As Stifu mentioned, this is about providing professional example code if you are trying to "teach" someone how to do something. Even if the first draft published contains error(s), it is well advised to re-publish new versions with the revised code and provide an edit note to the post indicating that issues were fixed. I took one of the files from the zip from MIX08,... dom.storage.html   did a small cleanup on it and dumped it into pastebin as HTML 4.01 Transitional (since the form had a name, etc.) to ensure it had a doctype. Total time to do this? about 20 seconds.  MSFT should have no trouble doing the same. Revised version of: dom.storage.html http://pastebin.com/f3544139

  • Anonymous
    July 15, 2008
    @anonymous: Is that the same MobileMe site that uses tables for layout, and is littered with inline styles?

  • Anonymous
    July 15, 2008
    This is off-topic but with IE8 will we be given the option to view RSS feeds as a long list of links just as in Firefox, instead of a preview page? I would really appreciate this if you could have this feature, or even better, if it was the default.

  • Anonymous
    July 15, 2008
    @Erel, yes.  you can do this in the 8 beta at least.  I believe if you right click on a feed in the feed list, there is an option to add it to the toolbar and that will function just like the live bookmarks in ff

  • Anonymous
    July 15, 2008
    I guess some of you people just read a couple of CSS books and now you're all experts huh? He's not designing you a website he's showing you an example. I guess some of you have never seen a tech demo before.

  • Anonymous
    July 15, 2008
    Chris: you're missing the point. Whether it's a site, an example or whatever... They're using X/HTML, and should at the very least use clean and consistent code, even if it doesn't validate (or stop acting like they actually care about standards). It's not about being a CSS expert or not, it's about showing the good example to people... as well as showing some respect (rather than disdain, carelessness, laziness or arrogance, pick whichever) to the developers this doc has been made for.

  • Anonymous
    July 16, 2008
    The comment has been removed

  • Anonymous
    July 16, 2008
    The comment has been removed

  • Anonymous
    July 16, 2008
    The comment has been removed

  • Anonymous
    July 16, 2008
    I agree about the examples - I would be embarrassed to show examples like that.  How can something like that ever be included in training manuals and standards definitions? Now - why should we use this new feature?  It only works on IE 8 which will probably be around 15% of my userbase, and it is not standard so is not guaranteed to work in the future. Why not concentrate on implementing current standards rather than creating your own IE8 standard (much like your unloved IE6 standard)?  You are just creating more problems for yourselves in the future by not working with everyone else on standards that everyone can use. I am not saying this is a bad idea, but why not work with everyone else rather than seeming to be working against the entire industry.  I agree with Apples stance on IE7.  Why should we all waste our time and money on your half-baked browsers?

  • Anonymous
    July 16, 2008
    The comment has been removed

  • Anonymous
    July 16, 2008
    Mitch... Poor guy.  Hope you find a more interesting job.  I suppose that might cut back on your time to leave such valuable insights here though.

  • Anonymous
    July 16, 2008
    billybob, I suppose in the kerfuffle about how html samples should be provided, you might have overlooked the fact that this is part of the html5 standard, not some mythical "ie8 standard". Surely agree with the world's stance on safari?  It's fast, but it's also full of security holes.  Surfing with safari is like carrying a big sign that says "pwn me!"

  • Anonymous
    July 16, 2008
    Ted: My apologies, I missed the reference to hashchange on the HTML 5 spec. As per usual though, there are lots of IE only examples and some incompatibilities which will bite someone one day, or will require everyone to write wrapper scripts. The spec says: "Firing a simple event called e means that an event with the name e, with no namespace, which does not bubble but is cancelable" MSDN says: "Bubbles Yes" Even the MSDN document says "Standards Information There is no public standard that applies to this event." The only cross platform way to add this event is the onhashchange attribute, which is not part of the standard.  addEventListener is the way to go...

  • Anonymous
    July 16, 2008
    IE8? Is that true? What a big version right? However, from what I have seen from your source code (bad-formed HTML and Obtrusive Javascript), I think that you mentioned IE6 + 2. What are you trying to improve if you don't have any idea on standard-based design principles? Please feel free to disagree wih me but IE6+2 is a better name than IE8

  • Anonymous
    July 17, 2008
    @Ted: please waste 5 minutes and complete the following test: Write a (C/C++/C#/ASP/PHP/JS/whatever language rocks your boat) program that outputs all numbers from 1 to 100 on screen, but replaces all multiples of 3 by Fizz, all multiples of 5 by Buzz, and all multiples of both by FizzBuzz. You have a single, small sheet of paper, a pencil, 5 minutes and no eraser. If you succeed (you need to do it correctly), then great: you're one of the 0.5% of the developers group who can actually program your way out of a paper bag. If you don't, I laugh in your general direction (and yes it's a misquote).

  • Anonymous
    July 17, 2008
    The comment has been removed

  • Anonymous
    July 17, 2008
    XML objects and methods compatibile with W3C specifications please!

  • Anonymous
    July 17, 2008
    @JamesB The guy speaks English (with what I think is an central African accent)... maybe not the one you are used to... Do remember the tune "you say tomato and I say tomahto"? Using Word for code presentation is terrible, granted.

  • Anonymous
    July 20, 2008
    I realize this isn't an ideal place to post this comment, but it is navigation-related and this seems like one of the few forums people on the IE team actually monitor.  (With that being said, my apologies if there is indeed a more proper place.)  I beg you, IE team, I plead with you, give users the option to turn off the "Backspace" button press=equals go back to the previous page "feature" in the IE 8 RTM version 9or better yet, beta 2).  I know developers can turn this off on their text-entry pages with Javascript (and they should) but many choose not to.   This functionality can be turned off in the FF "about:config" panel, and having done so I'm now using FF for most of my posting to forums, etc. and IE for most of my browsing (I like IE's tabs implementation much better than the one in FF), but that's probably untenable as a permanent solution for me.   I don't want to underestimate the seriousness of making even minor changes to IE, but I can't see how it would be that hard/disruptive to add yet one more option to the "Advanced" tab in the "Internet Options" screen so that one can switch off this extremely irritating default function if one so chooses.   In any event, thanks for your time.      

  • Anonymous
    July 20, 2008
    @An Irritated But Loyal IE User/Developer: I don't really think that can be done that easily, as you're hitting on a basic interface event handler here. Deactivating backspace=window.history.back() may yield such problems as the backspace key being deactivated for all applications in Windows having an history functionality (after all, this is a 'window' object property's method); in the best of case it can be disabled at a user level, but if it can't then, all users will have backspace deactivated too (system-wide setting). I would guess Vista may prevent that through protected mode (that always makes me think about i286 protected...), but since XP is with us for 5 more years... That's a risk MS can't take, considering MS software's history of having strangely changing settings from one session to another (locale switching back and forth from French to US without any user intervention, for example): Joe User not having his backspace key working any more after a reboot would lead to quite an outcry. Please note that this is true of Firefox too, however in their case it doesn't lead to a system reinstall/format, and about:config is easier to edit than the win32 registry. You can try something else: program a webpage that loads any other page in an iframe (to make things easier, you can recreate the basic navigation controls at its top, the iframe taking up the rest); your parent webpage intercepts the backspace key, you get what you're looking for. Now let's just hope that security measures won't impede that too much... The second-best solution would be to add this setting to a Trident-based browser like Maxton.