Topic: Using XMLHttpRequest to upload images without refresh (Read 842 times)
Community Supporter?
What a dork
Posts: 17
114 credits Members referred : 0
« on: Oct 02, 2007, 09:53:46 AM »
It looks like it is possible with setting the header and possibly encoding the image with jscript. After a few hours my head just got fuzzier.
I'm trying to do it raw or without Ajax since it looks like Ajax uses those methods above anyway. Please correct me if wrong of course.
req=new XMLHttpRequest or ActiveXObject("Msxml2.XMLHTTP") or ActiveXObject("Microsoft.XMLHTTP");
params are the parameters to send a post this way. params = 'var1=value1&var2=value2'
req.send(params)
But little is explained about images. if anyone knows please post as it is an alternative to hidden iframe This saves some issues with the iframes php page to do it this way.
I am a metal monkey!
Administrator Community Supporter?
Jedai Sword Master
Gender:
Posts: 7975
40807 credits Members referred : 3
« Reply #1 on: Oct 02, 2007, 10:07:50 AM »
Hi apple2 and welcome to webdigity
Why don't you use a javascript library for AJAX (like scriptaculous or moo effects)?
Hi apple2 and welcome to webdigity Why don't you use a javascript library for AJAX (like scriptaculous or moo effects)?
Thanks!
I'd like not to be dependent on a library which is simply using browser languages because I'd be including functions I do not understand and would be programming without a transparant view of what is going on. By coding from the ground up I'm expecting not to need libraries for much except things which are a real pain with browser compatability.
Please correct my mentality where wrong. I've coded from 1983 to about 2002 lots then 2003 till now ran a company and just did enough php/web/jscript to get by.
When I hear to use Ajax and try to use Ajax I haven't gotten anywhere. If I download Ajax then there is a big library.
Should I be doing it with Ajax then pick apart the code used to optimize? It sure seems more right to understand the code the guys used who wrote Ajax. Am I going about this backwards? Again when I try to go the Ajax route I'm not aware of how to use the functions and am stuck not only learning commands but someones library.
Global Moderator Community Supporter?
Jedai Sword Master
Gender:
Posts: 6280
38506 credits Members referred : 374
Community Supporter?
What a dork
Posts: 17
114 credits Members referred : 0
« Reply #5 on: Oct 03, 2007, 06:02:47 AM »
The Ajax sites are great links thanks! I need to speed up to understand them or go through them without feeling intimidated. Also the sites I pulled up on xhttp looked a bit like you can post an image with it! For my current needs an Iframe will do but adding the ability to do it without one makes coding easier.
Here is a link to a thread starting with basic iframe attachments that will cover more fancy attachments. Thats how I get re-warmed up to hard core coding then I'll come back here and rip apart the xhttp objects, dom or whatever once I see document.write in my nightmares. Should be 4 days