ASP.NET AJAX Team Blogs

Browse by Tags

All Tags » Internet Explorer (RSS)
querySelectorAll on old IE versions: something that doesn’t work
In today’s post, I’m going to show an interesting technique to solve a problem and then I will tear it to pieces and explain why it is actually useless. I believe that negative results should also be published so that we can save other people from wasting time trying the same thing. So here goes… A few days ago, a post on Ajaxian proposed a new version of a somewhat old technique to implement querySelectorAll on old versions of IE, using the browser’s native CSS engine. That sounds like a great idea at first, and the hack is quite clever. The idea is to dynamically add a CSS rule to the document that has the selector that you want to evaluate, and an expression that adds the matched elements to a global array. When I read this, it reminded me...
Why is ASP.NET encoding &’s in script URLs? A tale of looking at entirely the wrong place for a cause to a non-existing bug.
Several people have reported seeing errors in their logs that seem to be due to requests such as this: /ScriptResource.axd?d= [lots of junk] & t=ffffffffee24147c The important part here is the HTML-encoded “&” sequence, which stands for “&” of course. If this exact URL is sent to the server, the server won’t know what to do with the escape sequence (URLs are not supposed to be HTML-encoded on the wire) so the parameters won’t get separated as expected, potentially resulting in a server error. This bug in the toolkit is an example of that: http://ajaxcontroltoolkit.codeplex.com/WorkItem/View.aspx?WorkItemId=13134 Of course, when people see 500 errors popping up in their server logs, they immediately assume the application...
How to choose a client template engine
Disclaimer: I worked on the Microsoft Ajax 4.0 template engine, so my criteria are of course heavily influenced by our own design. Templates are a data rendering method that server-side developers have enjoyed since the old days of classic ASP and PHP. The idea was quite simple (add code blocks and dynamic expressions directly into HTML markup) but it revolutionized web development, which before that relied on the opposite method (spitting HTML from CGI code). On the client-side, the browser provides two ways to generate HTML: innerHTML and the DOM API. Template rendering is of course possible, but only using a JavaScript library. To be honest, one should mention XSLT here, which is standard and widely supported but whose somewhat unusual syntax...
JavaScript Behavior Sheets: an experiment
Here’s a little experiment. I’m really after feedback on this one as I’m trying to decide whether this is a good idea. It’s also entirely possible somebody else did this before. That would be good feedback too. Anyway, here it is. Despite its shortcomings, CSS has a number of features that make it very compelling. First, it decouples styling from markup. Second, its selector syntax is simple, yet reasonably powerful. So we have semantic markup on the one hand, and styles on the other hand, and the only coupling between the two is the selectors in the stylesheet. In Ajax applications, there is a third kind of entity in the mix, JavaScript behavior. There are of course ways to decouple the script behavior from the markup, which are usually referred...
WCAG 2.0 is now FINAL!!!
From SlashDot... "It has been going on nine years now, but finally there are formal standards for Web accessibility for technologies other than HTML . They ask that you start with the press release (lots of links), but regulars might be more entertained by the last time WCAG made the front page here. Many folks here will point out that web accessibility is old hat, and by implication this is hardly news, but if you do Web development for any government organization, you should expect that accessibility is a base requirement. The Section 508 standards are to be updated (relatively) soon too." This is great news for government developers! Being finalized, this specification incorporates accessibility guidance for Web 2.0 technologies...
OpenAjax requests comments on browser wishlist
The OpenAjax Alliance has been working with some of the top Ajax developers on a wishlist that aims at gathering and prioritizing the development features that we need the most from next generation browsers. The process is completely open and Wiki-based, so feel free to contribute. http://www.openajax.org/blogs/?p=53 Read More...
Getting absolute coordinates from a DOM element
For some reason, there is no standard API to get the pixel coordinates of a DOM element relative to the upper-left corner of the document. APIs only exist to get coordinates relative to the offset parent. Problem is, it's very important to get those coordinates for applications such as drag and drop, or whenever you need to compare coordinates of elements that may be in completely different parts of the document. In Microsoft Ajax, we implemented such a function but it proved to be one of the most difficult problems we had to solve. Not so surprisingly, every single browser has its own coordinate quirks that make it almost impossible to get the right results with just capability detection. This is one of the very rare cases where we reluctantly...
More Posts