by Kofi Sarfo
23. September 2009 01:18
The following StackOverflow post is interesting not so much because of the text but how it's rendered.
We begin with a <div> tag which contains an expected id attribute format and using a jQuery regular expression we're able to match all div elements with an "id" attribute beginning "RSSContent".
<div id="Container">
<div id="RSSBlock">
<div id="RSSContent200909222115"
runat="server"
title="http://stackoverflow.com/feeds/question/477962" />
</div>
</div>
The "title" attribute for each element matched is used in an HTTP post of content-type application/json to a web service which acts as a proxy to overcome cross-scripting JavaScript constraints. This returns the post above which I found useful recently.
It's not an elegant solution. I've hacked the div element, using the "title" attribute to hold the URL and the directory structure isn't great either. The web service creates a user control which appears to work only in the root directory and the web application project requires a reference to an identical control in another project. The things we do for code compilation!
The end result is that rather than cut & paste, which would have been far easier we're using using an external resource to supply text so that if the RSS feed item was to change, for example, then we'd still display the most current version.
An XLink implementation, this is not. It's just an example of how I thought the web might work sometime soon after 2001... What we're missing here, conceptually at least, is meta to describe the relationship between this post and the one referenced. Well, in this case the meta is only human-readable and quite incomplete.