If you're trying to do what I think that you are trying to do then JavaScript is the way wrong way to go. Do you have PHP available?
“The power of the Web is in its universality. Access by everyone regardless of disability is an essential aspect.”
—Tim Berners-Lee, W3C Director and inventor of the World Wide Web
Shortly speaking you could not upload anything to server without receiving this stuff on server.
I.e. if your server is "passive" and only contains static html web pages, you could not upload anything to it.
You need not javascript. What you want is done via form element "input type=file" or "textarea" depending on whether you want to browse for your file or to paste it into text field. When form button "submit" is clicked the request is sent to "action" url of the form.
Server should be able to properly receive this request, handle and store file.
JavaScript is client-side scripting language and have nothing to do with it.
So you need to set up your server to work with cgi, php, asp or other kind of scripts and then get back here to forum - I think the rest would not be very complicated. ;-)
In PHP it's way easy. But we'll need a wee bit more information.
Where is the XHML? On the same file server as the PHP or elsewhere on the web? You'll have to get the file somehow. If it's elsewhere on the web things can get a little bit more involved.
Do you want the whole XML file or just a part? And if it's just a part we'll need the match criteria.
How big is the XML file? For small files things are way easy with DOMDocument. But for large ones you'll want to use the XML Parser.
How do you want the XML transformed? We have to get it into HTML if we're going to embed it in HTML.
“The power of the Web is in its universality. Access by everyone regardless of disability is an essential aspect.”
—Tim Berners-Lee, W3C Director and inventor of the World Wide Web
Ive managed to do it in JavaScript :-) The only thing is in my xml file I have <Image>images/male.jpg</Image> This holds the location of the image wanting to be loaded however it doesnt load the image instead it just displays images.male.jpg.
You have any idea why? Cheers for the advice etc :-)
Have you any troubles with reading and understanding what you've been told by colleagues?
You could not, could not, could not upload file with only javascript to server. You could load the file into your browser and display it, but this have nothing to do with uploading to server.
Don't use JavaScript for this. PHP is 1) easier and 2) acrtually works. Lots of people, teeming masses, among them myself, don't use JavaScript. When we hit your page it won't work.
“The power of the Web is in its universality. Access by everyone regardless of disability is an essential aspect.”
—Tim Berners-Lee, W3C Director and inventor of the World Wide Web
Bookmarks