Closed Thread Icon

Preserved Topic: XHTML Strict, Loading external content into pages? (Page 1 of 1) Pages that link to <a href="https://ozoneasylum.com/backlink?for=18325" title="Pages that link to Preserved Topic: XHTML Strict, Loading external content into pages? (Page 1 of 1)" rel="nofollow" >Preserved Topic: XHTML Strict, Loading external content into pages? <span class="small">(Page 1 of 1)</span>\

 
Dracusis
Maniac (V) Inmate

From: Brisbane, Australia
Insane since: Apr 2001

posted posted 09-30-2002 02:56

I've noticed that Frames & iFrames are not part of the XHTML 1.0 and 1.1 strict specifications.

Is there any way to load data into a page without having to reload and re-render the page using these specifications? I've searched high and low but all I could find was a Windows only active X hack. Darn it!

Although I did come accross a couple of stray articles here and there about useing a Java applet to read txt files from a local directory into a Javascript variabule. Although most of those were written a while ago (like this one) and only work if the Browser supports liveconnect or something like that, which apparently IE for the mac and Opera for almost any OS don't do too well. Is this now the only semi cross browser & cross platform way to dynamically load external data into XHTML?

Seems like one step forwards for the standards, one step backwards for functionality.

Please tell me I'm wrong. Please.

Dracusis
Maniac (V) Inmate

From: Brisbane, Australia
Insane since: Apr 2001

posted posted 09-30-2002 03:46

Arrr... Just found some info on xFrames.

Pitty that didn't decide to do this sooner . This should have been developed side by side with XHTML 1.0 IMHO.

Arr well, I'll just keep using XHTML Transitional untill it becomes availabul. Still, if anyone has any info on being able to load content without re-rendering a page for strict DTD's then I'm all ears. The possible Java solution I mentioned before seems to have all sots of issues with various browsers and varing OS falvours.

Hmmm... maybe I could pass data back and forth through flash and javascript. Any flash guru's in da house?

Bugimus
Maniac (V) Mad Scientist

From: New California
Insane since: Mar 2000

posted posted 09-30-2002 04:31

Umm... doesn't the "innerHTML" method still work? I know it's not really standards compliant but I think there's an equivalent in the standard but it's just a little weirder.

I actually had a question about whether the XHTML even applied to how the javascript was crafted. I read somewhere that it would be better to externally link all your scripts for XHTML compliant pages.

I'm still trying to get up to speed on this myself.

. . : slicePuzzle

[This message has been edited by Bugimus (edited 09-30-2002).]

Dracusis
Maniac (V) Inmate

From: Brisbane, Australia
Insane since: Apr 2001

posted posted 09-30-2002 06:08

Yeah innerHTML() still works although it's not actually a DOM standard. Although I'd like to hope it does become one.

The whole XHTML / Javascript is a little confusing at first. It breaks down like this:

First off, XHTML is an XML language marked up like HTML. XML browsers will treat is as XML, HTML browsers can still understand it because the syntax is the same as HTML. Although the Strict DTD's remove a lot of HTML like <font> and <frame> tags bacause they say such things can now be done with CSS and XSL. Although I must have slept in on the day where they explained how CSS or SXL can replace Frames?... No I'm not bitter, just a little jaded.

In XML/XHTML Javascript gets replaced with ECMA Script. ECMA Script is not a browser specific language, it's meant to be a cross platform and application independent scripting language. Apparently MS use ECMA script for scripting certain things in Windows (ECMA Script plugged into ActiveX... dot.NET anyone?) ECMA Script is based on Javascript and the syntax is pretty much identical. ECMA Script is basically Javascript without any application specific objects, properties or methods. Just control structures, variable types, a math object etc?

As for getting ECMA Script to communicate with any kind of application or web browser well, that's up to the application developer.

Enter the DOM. The DOM is the application specific bit. You can access the DOM through ECMA Script. So basically ECMA Script + DOM is effectively what Javascript once was, or is, or something like that. W3C are trying to standardise the way a DOM is structured so that it's the same in all XML / XHTML / HTML clients. Like that's ever gonna happen but at least someone's trying.

Anyways, the problem I'm having is being able to load content into an HTML page from an external file without have to reload said HTML page. Like the iFrame buffering trick. You'd load a HTML file into an iFrame and set an onload flag in the loaded HTML file so when it loaded you could innerHTML() the data to where ever you wanted to display it.

The problem is that XHTML Sctict DTD's don't allow iFrames or any alternative to loading/reading an external file without reloading the page. I know that I could include files using PHP or some other server side thingy but what if I wanted to switch between files without having the entire page refresh/reload? Well, in XHTML strict I can't and it's annoying me to no end.

The only option I'm really left with now (if I want to use XHTML 1.0 or 1.1 strict DTD's that is) is to include all the data I want when the page renders but for the site I'm trying to design that's gonna be a shite load of data. Around 200k actually.

Although now I'm thinking flash might provide a suitable cross-browser solution to this problem. Since flash run's in an object tag and for all intent purposes is completely separate from an XHTML page it can load data and such without the page needing to reload. Effectivly living in it's only little flash iFrame kinda thingy. All I have to do is figure out a way to phrase data out of flash and into a Javascript variable. Possible?...no dobut I'll be up all night trying.

It's a pity there's a gap in the available technologies. HTML supports <frame> and <iframe>, XHTML 2 supports xFrames (So I'd assume anyways). IE6/Moz support HTML and XHTML 1 but not XHTML 2. So if you want to use XHTML 1 then your going to be lacking in functionality compared to HTML where frames are concerned. Which will probably mean the true switch to XML on the web will be held back by XHTML 1.0 transitional DTD's (as far as I know XHTML 1.1 can only be strict) until the next round of Browsers are released.

Hmm.. maybe I should have put this in the XML forum.... arr well.

Bugimus
Maniac (V) Mad Scientist

From: New California
Insane since: Mar 2000

posted posted 09-30-2002 06:12

Perhaps, thanks for the run down. I see what you mean now. You need the equivalent of the iFrame to shovel in the data. Errrm, what a bummer if there is no way of doing that in the strict versions. Hey, isn't there a "frames" DTD? Perhaps that's the only way to do it? I'm just not knowledgable about this stuff yet to be able to say.

genis
Paranoid (IV) Inmate

From: Dallas, TX
Insane since: Aug 2002

posted posted 09-30-2002 06:32

no no no no.

There is no iframe etc, because the <object> element takes its place.
<object> is supposed to take the place of almost any embedded object you can put in, it will eventually replace the <img> tag as well.

Unfortunately only Mozilla, that i know of, handles this.
I still have to use iframes for F@#%ing Internet Explorer and use the XHTML Transitional DTD.

But hey man, that's why they have the Transitional DTD, because browsers are slow to catch up.
It's not a slam to your technical abilities to use the TransDTD, so just use it when you have to.

Bugimus
Maniac (V) Mad Scientist

From: New California
Insane since: Mar 2000

posted posted 09-30-2002 06:49

Ugh, but it just doesn't seem as "cool" if you don't. But if that's the only way then...

. . : slicePuzzle

Dracusis
Maniac (V) Inmate

From: Brisbane, Australia
Insane since: Apr 2001

posted posted 09-30-2002 07:04

But but! I dun wanna use it!

How can I use a transitional DTD and still be an uber 133+ web ha><0r?

Hehe. Alright, I'll use the Transitional Doctype.

Object tag you say? I must have slept in that day too. Oops. Got me some more reading to do. Thanks the the heads up there genis.

Dracusis
Maniac (V) Inmate

From: Brisbane, Australia
Insane since: Apr 2001

posted posted 09-30-2002 07:27

Ohh... just found a nice atricle on the matter, thought it worth sharing, here:
http://www.cadenceweb.com:8080/newsletter/sheerin/webstandards/

** Warning: site is designed using said <object> tag correctly hence won't render nicely in IE, or NN4, and it does some amazingly amusing things in Opera. Yay, chalk another one up for Mozzi!

Edit:

Just found a nice <object> test page:
http://www.student.oulu.fi/~sairwas/object-test/

And I've got some of the HTML/Text embedding examples working the trio (IE6/Moz1/OP6) on Mah PC. It's a pity they don't list which Browser/OS combo's support which demo's. I don't suppose anyone has a Mac handy that they could toss at them then let me know how things pan out?... Come on, I'll be ya best friend!

Ok then, I'm off to see if I can change the embedded content after the page has rendered, and if so, read it with javascrpt. I'm not liking my chances but I'll let ya'll know how it turns out.

[This message has been edited by Dracusis (edited 09-30-2002).]

psych3
Nervous Wreck (II) Inmate

From: Australia
Insane since: Feb 2001

posted posted 10-03-2002 09:03

This loads external html files and validates as xhtml1.1 strict.
http://dhtmlnirvana.com/test/externalex.html

Its based of the code I have at my alchemy site, the only thing different to there is i use createElement() to dynamically generate the iframe for me.

BTW you can have iframe and frames in xhtml1.1, but, you need to physically edit the dtd to include the modules as they are not included by defualt, but are part of the specs. The DTD is a pain to edit believe me! You can either do what i did and dynamically write the iframe or a good alternative is to generate a W3 schema of your xhtml document. XMLSPY will generate a schema for you.

Hope this helps


Eddie Traversa
http://dhtmlnirvana.com/
http://333creativecentral.com/

[This message has been edited by psych3 (edited 10-03-2002).]

Dracusis
Maniac (V) Inmate

From: Brisbane, Australia
Insane since: Apr 2001

posted posted 10-03-2002 11:46

Hey thanks! That's a nice idea. Although it kind of subverts the idea of using <object>'s for any embeded data but it does make a perfect intrem (<-sp?) solution.

Thanks for the DHTML Nirvana tutorial pages too, they've come in hand many times over!

I was also thinking about extending the xhtml1.1 DTD but after looking at one and failing dismally to understand it I thought I'd have a better chance at winning the lottery.

Although, I've had to put my site on hold, again!... I'm knee deep in director lingo at the moment.

I swear, by the time I even get close to finishing my personal site IE version 8 will be the norm! heh...

« BackwardsOnwards »

Show Forum Drop Down Menu