Closed Thread Icon

Topic awaiting preservation: Yay for XMLHttpRequest()! (Page 1 of 1) Pages that link to <a href="https://ozoneasylum.com/backlink?for=24973" title="Pages that link to Topic awaiting preservation: Yay for XMLHttpRequest()! (Page 1 of 1)" rel="nofollow" >Topic awaiting preservation: Yay for XMLHttpRequest()! <span class="small">(Page 1 of 1)</span>\

 
Iron Wallaby
Paranoid (IV) Inmate

From: USA
Insane since: May 2004

posted posted 02-09-2005 18:47

Well, after my previous failures with XMLHttpRequest, I decided to try something practical this time... and came up with something good.

http://www.rpi.edu/~laporj2/photos/

It's not very polished, but it does work fine. It uses XMLHttpRequest to open up db.xml (which is just an XML file containing the data related to all the pictures, pretty simplistic). It then creates a clickable menu from it and allows the user to look at a photo gallery pretty easily. Not to mention, it's only 16 lines.

It also means I just have to tweak a little XML file whenever I decide to update my photo gallery.

I've tested it in MSIE, Mozilla Firefox, and Konqueror, which all work perfectly. I havn't yet tried Safari (though I fully expect it to also work) or Opera.

"Any sufficiently advanced technology is indistinguishable from magic." -- Arthur C. Clarke
"Any sufficiently arcane magic is indistinguishable from technology." -- P. David Lebling

(Edited by Iron Wallaby on 02-09-2005 18:48)

poi
Paranoid (IV) Inmate

From: France
Insane since: Jun 2002

posted posted 02-09-2005 23:22

clean code.

I've tested it in Opera 8beta and the images don't show up on the first click on the links. The images seems to be loaded, as the loading progress bar shows up. But the display is not updated the first time an image is loaded.

Tyberius Prime
Paranoid (IV) Mad Scientist with Finglongers

From: Germany
Insane since: Sep 2001

posted posted 02-10-2005 09:36

neat.
XmlHTTPRequest is really a powerful functionality.
I'm building a fairly sophisticated 'web application framework' with it right now, which never looses any input data.
I combine it with iframes to transfer posts in the background (couldn't see any way to assemble file uploads into xmlhttp requests...),
and a lot of javascipt, so whenever a user leaves a 'page' (which of course is loaded via xmlhttp, and possibly cached if static),
it posts back to the server, who stores the data in it's session till the user either clicks cancel or save on the document at hand.

CPrompt
Maniac (V) Inmate

From: there...no..there.....
Insane since: May 2001

posted posted 02-14-2005 19:51

that's really cool. I dig how you did the menu.

I might have a use for something like this on my companies website. can i mod this script to play sound files?

thanks in advance!

Later,

C:\

Hugh
Paranoid (IV) Inmate

From: Dublin, Ireland
Insane since: Jul 2000

posted posted 02-14-2005 21:55

Obviously IE latest and Firefox/mozilla support this, but how far back is this function supported ? I'd use it for all my webpage content if I knew most could see it.

Tyberius Prime
Paranoid (IV) Mad Scientist with Finglongers

From: Germany
Insane since: Sep 2001

posted posted 02-14-2005 22:03

then don't.
Opera does not support it till the newest beta.
IE supports it starting with 5.5, I believe.

Gilbert Nolander
Maniac (V) Inmate

From: Washington DC
Insane since: May 2002

posted posted 02-14-2005 23:36

That is pretty neat,

What if the picture is larger that 640px by 640px though?
Won't it be to big to fit inside the frame set by #image?
Is there any way to fix this, to make the picture size relative so it will fit inside the image area.
I'm not sure if this is possible with the background- CSS Stuff.

CPrompt
Maniac (V) Inmate

From: there...no..there.....
Insane since: May 2001

posted posted 02-15-2005 00:01

yeah........I think I am going to just do my deal with php. the all "CSS" pages even gives people problems........loosers

Later,

C:\

Iron Wallaby
Paranoid (IV) Inmate

From: USA
Insane since: May 2004

posted posted 02-15-2005 00:21

CPrompt: Mess with it to your liking. As far as a company website, though, for an image gallery like this it's probably better to generate a page with mod_perl/PHP/scripting-language-of-choice and use the Javascript to load each image.

Gilbert: All the images are specifically made to be 640x640 max. I keep all the originals on my harddrive, I see no reason to keep bigger ones online, especially since it's just a photo gallery. Yes, it can be fixed; it's just that I don't have any reason to. (the easiest way would be to alter the xml file to include image size stuff)

As far as I'm aware, XMLHttpRequest works in MSIE5+, Mozilla 1.0+ (and the equivalent versions of FF and Netscape), Opera 7.?, Safari 1.1+, and Konqueror.

"Any sufficiently advanced technology is indistinguishable from magic." -- Arthur C. Clarke
"Any sufficiently arcane magic is indistinguishable from technology." -- P. David Lebling

Tyberius Prime
Paranoid (IV) Mad Scientist with Finglongers

From: Germany
Insane since: Sep 2001

posted posted 02-15-2005 08:54

not opera 7.
Opera 8 beta supports XMLHttpRequests partially - the setHeader() function is still missing.

CPrompt
Maniac (V) Inmate

From: there...no..there.....
Insane since: May 2001

posted posted 02-15-2005 15:35

thanks Iron Wallaby. I'm gonna keep the script and mess around with it just for giggles. For the company website I am doing something for sound clips. Same difference. Just gonna use php for it. Like I said, some of our customers had problems with the all css much less something as new as this

good work though. that is really good stuff.

Later,

C:\

Gilbert Nolander
Maniac (V) Inmate

From: Washington DC
Insane since: May 2002

posted posted 02-15-2005 22:54

oops.nevermind.

(Edited by Gilbert Nolander on 02-15-2005 22:55)

Scott
Paranoid (IV) Inmate

From: schillmania.com
Insane since: Jul 2002

posted posted 02-21-2005 05:56
quote:
Tyberius Prime said:

not opera 7. Opera 8 beta supports XMLHttpRequests partially - the setHeader() function is still missing.

Oh, I thought 7.5 supported it partially?

Bugimus
Maniac (V) Mad Scientist

From: New California
Insane since: Mar 2000

posted posted 02-24-2005 19:06

I love this! I'm redoing my guestbook and I'm going to be taking XMLHttpRequests for a test drive. This is very very cool.

: . . DHTML Slice Puzzle : . . .

Scott
Paranoid (IV) Inmate

From: schillmania.com
Insane since: Jul 2002

posted posted 03-01-2005 16:57

Looks like the Opera guys added full xmlHTTP support!

http://www.opera.com/windows/changelogs/800b2/

liorean
Bipolar (III) Inmate

From: Umeå, Sweden
Insane since: Sep 2004

posted posted 03-03-2005 00:12

Scott: My memory might be wrong about this, but I have some slight notion that it was after the 7.54 final versions that XMLHttpRequest support was added. (Might be wrong about that, but I can check if you wish.) Op7.60/8.0 was more than a small upgrade...

The problem with XMLHttpRequest is that there is no browser with "full" support. And this is because opa and saf tries to support the features of the iew object in moz style packaging, while moz have enhanced it from how it works in iew. But on the other hand moz is not as good with handling raw data as ie6w, and has at least one CPU hogging problem.



This is entirely ripped from memory but I think the support is moz, ie5.5+w, saf1.1+ (like there are any 1.1 users left...), op7.6+ and I'm unsure about which exact version of konq. Notable lack of support can be found in ie5m, msn/osx, ie5.0w. Notable bugginess is that saf (and presumably also Konq) has a few crashers in the 1.2 versions of it if you try to use the moz features that ie6w didn't support. Op fails but doesn't crash in most of said situations.

--
var Liorean = {
prototype: ProgrammingTheoryGuru.prototype,
abode: "http://codingforums.com/",
profile: "http://codingforums.com/member.php?u=5798"};

« BackwardsOnwards »

Show Forum Drop Down Menu