|
Posted by RichardOnRails on August 22, 2007, 12:24 am
Please log in for more thread options
> RichardOnRails wrote:
> > Hi,
>
> > I've got a web page that's a work in progress (it's only got dummy
> > data displayed) at
> >http://home.comcast.net/~CaptQueeg/AccordionMenuTest.html
>
> [...]
> > Is feasible to replace that div's innerHTML with the selected content
> > using scripting? Is there a CSS mechanism that would be helpful?
>
> It's possible to use AJAH (asynchronous JavaScript and HTML) to replace
> the contents of the division "content" with actual HTML data downloaded
> from the site.
>
> Google it to find material on how to handle XMLHttpRequest on various
> browsers.
>
> Beware: It may make the site inaccessible to people who disable JavaScript
> like me, or use an alternative browser (neither IE nor FF), such as Opera
> that I use...
> So, you must provide regular anchors, as you currently do, and handle the
> onclick event to provide the downgraded version for guys who like
> JavaScript.
>
> However, there are issues:
> 1) The document model of the Web is broken.
> Bookmarking, the back button, external links to your page, and
> technologies assuming that one URI identifies one resource, are broken.
> In the worst case, web crawlers may not index your site correctly.
> 2) The client/server model of the Web is broken.
> The web client need to be a full-featured JavaScript engine that *obeys*
> to the orders coming from your server, through a turing universal
> programming language. Your web page becomes the client of my computer, and
> my computer becomes the host.
> Every JavaScript is a threat.
> 3) ECMAScript bindings are badly standardized, and XMLHttpRequest is not
> standardized at all. It's hard to make a thing work on more than two or
> three browsers. Even harder to make a thing work on non-browser user
> agents.
>
> Please, please, don't use AJAH when it's not necessary. For your case, it
> clearly is unnecessary.
>
> There are alternatives:
> 1) Providing the static part of your site (navigation menus) in every
> page. You may use a server side script to generate that. Don't make the
> client do the work of your server. (AJAH could save bandwidth, but it's
> not worth it).
> 2) Using the infamous HTML 4.01 Frameset, putting your menu on the left
> side, and the contents on the right side.
> Personally, I find HTML frames better than AJAH. HTML frames don't totally
> break the document model. They're just a strange means to handle more than
> one document at a time.
> Frames have many defects, but, from my subjective experience, I find them
> much less offensive than AJAX or AJAH.
> 3) Using HTML 4 iframes for the contents. It shares accessibility problems
> with framesets and AJAH, but is better than AJAH, because it doesn't use
> JavaScript, doesn't reverse the client/server model, doesn't raise many
> browsers incompatibility issues, doesn't entirely break the document
> model, as, usually, it's still possible to select the iframe and open it
> in a different window, get its URI, bookmark it and distribute it.
>
> (Oh, yeah, I should surf on the AJAX hype, as everybody do, but I don't).
> --
Hi Andr=E9,
Thank you very much for your thoughtful response.
You addressed a number of scenarios. Let me add some constraints on
this thing. My first application will be a presentation tool that
I'll run on a notebook and feed output to a project. I anticipate
creating applications for small businesses that will be running on
machines whose configurations will conform to my requirements.
So scripting and AJAX is definitely in -- or AJAH, which I didn't
know about. I used Frames years ago for precisely this purpose. But
I want to stay with current technology, so I like the coding here
(which I got from a few places ... and which I credited in source-
code comments.)
That said, I looked into AJAH at
http://www.codylindley.com/Javascript/237/axah-asynchronous-xhtml-and-http-= crawl-before-you-ajax.
It's perfect for my purposes. Thank you very much for mentioning it.
Best wishes,
Richard
|