Click here to get back home

How to publish external content in a div

 HomeNewsGroups | Search | About
 comp.infosystems.www.authoring.html    Post an article   get this group's latest topics as an RSS feed add this group's latest topics to your My MSN content add this group's latest topics to your My Yahoo content
Subject Author Date
How to publish external content in a div RichardOnRails 08-21-2007
Posted by RichardOnRails on August 21, 2007, 7:05 pm
Please log in for more thread options


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

When I click on any menu item, the referenced item is displayed on
the current window. Using be back button, will allow me to select
another item and repeat the cycle.

As I recall, years ago I was able to direct that extenal content to a
frame on the currently displayed page. Now I've got a div that's got
the additional data displayed.

Is feasible to replace that div's innerHTML with the selected content
using scripting? Is there a CSS mechanism that would be helpful?

Thanks in advance,
Richard


Posted by André Gillibert on August 21, 2007, 7:39 pm
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).
--

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


Posted by Andy Dingley on August 22, 2007, 8:06 am
Please log in for more thread options


On 22 Aug, 00:05, RichardOnRails

> Is feasible to replace that div's innerHTML with the selected content
> using scripting?

Just use an <iframe>


Posted by RichardOnRails on August 22, 2007, 9:12 am
Please log in for more thread options


> On 22 Aug, 00:05, RichardOnRails
>
> > Is feasible to replace that div's innerHTML with the selected content
> > using scripting?
>
> Just use an <iframe>

Hi Andy,

Thanks for responding.

I agree that Frames would work. I've used Frames successfully in the
(distant) past for this purpose. But I haven't written much HTML and
only started studying this stuff seriously about a month ago. I'm
adopting the philosophy expressed in Wikipedia, which says (in
http://en.wikipedia.org/wiki/HTML_element#Frames):

<Quote> The use of presentational markup is discouraged. The
equivalent CSS should be used instead. Deprecated elements are only
valid in the Transitional and Frameset variants of HTML 4.01 and
XHTML1.0. They are invalid in the Strict variants of HTML 4.01,
XHTML1.0 and XHTML 1.1. <b>...</b> and <i>...</i> are invalid in the
current draft of XHTML2.0.
</Quote>

Nevertheless, W3Schools (in http://www.w3schools.com/tags/default.asp)
says frames are valid HTML 4.01, i.e. they have not been deprecated.
But I'm trying to adhere to the concept that HTML is for content, CSS
is for presentation, and JavaScript is for dynamic presentation.

My long-range goal is to use Ruby on Rails for website development,
and RoR uses AJAX for this kind of stuff. I feel I have to get a
handle on the underlying the underlying technology I just mentioned.
I think AJAH suits my purpose.

Best wishes,
Richard


Similar ThreadsPosted
Embedding external content - impossible? May 10, 2005, 6:45 pm
Can you display content from external URL in table? August 24, 2007, 3:02 pm
How to publish HD video on Web and protect it? August 26, 2006, 12:56 pm
Call for Presentations - Open Publish 2007 January 2, 2007, 4:01 pm
Open Publish 2007 - Keynote Speakers Announced February 12, 2007, 10:58 am
Re: External CSS and HTML 2.0 July 24, 2008, 11:06 pm
Force CSS on external site? December 13, 2004, 6:00 pm
External Links not showing. June 24, 2005, 10:21 pm
External style sheet a no go June 4, 2008, 3:35 am
Opening External Page in My Frameset September 22, 2004, 4:28 am

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap