473,804 Members | 2,085 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Javascript XMLhttp request help

Hi all i was just wondering if you help.

I have to send a cgi request to a company using xmlhttp request. They reply
back with a line of info but when you view the internet explorer source code
you see the XML format.

I was just wonder if anyone could help me save the xml format to a xml file.
I woul like to show you my code but there is to much confidential
information about the company.

Send me an email to mm******@tpg.co m.au or reply to my post.

Thanks Mark..
Jul 23 '05 #1
3 3096


Mark wrote:

I have to send a cgi request to a company using xmlhttp request. They reply
back with a line of info but when you view the internet explorer source code
you see the XML format.

I was just wonder if anyone could help me save the xml format to a xml file.


If your page is loaded via HTTP in a browser then it usually can't save
file to the local file system, whether you want to use XML or something
else.
You can of course script the response send by the server as
httpRequest.res ponseXML with DOM methods and send it back to the server
where a CGI script (or PHP or ASP or JSP) can save the XML as needed.

Of course it is als possible to use Microsoft.XMLHT TP with JScript in a
Windows Script Host file or an ASP page and there you can certainly save
to a file using the save method of the DOM document object (e.g.
httpRequest.res ponseXML).

--

Martin Honnen
http://JavaScript.FAQTs.com/
Jul 23 '05 #2
Hi again

The javascript html is running on windows server 2000/windows 2000. I have
the main bit of the code but I have replaced the confidential information
with the word "confidenti al".

function hit() {
xmlhttp.open("P OST", "Confidenti al ",true);
xmlhttp.onready statechange=fun ction() {
if (xmlhttp.readyS tate==4) {
document.write( xmlhttp.respons eText)
}
}
xmlhttp.setRequ estHeader("Man" , "POST Confidential HTTP/1.1")
xmlhttp.setRequ estHeader("Mess ageType", "CALL")
xmlhttp.setRequ estHeader("Cont ent-Type", "text/xml")

xmlhttp.send("< request>confide ntial</request>")
}
Mark
"Martin Honnen" <ma*******@yaho o.de> wrote in message
news:41******** *************@n ewsread2.arcor-online.net...


Mark wrote:

I have to send a cgi request to a company using xmlhttp request. They
reply back with a line of info but when you view the internet explorer
source code you see the XML format.

I was just wonder if anyone could help me save the xml format to a xml
file.


If your page is loaded via HTTP in a browser then it usually can't save
file to the local file system, whether you want to use XML or something
else.
You can of course script the response send by the server as
httpRequest.res ponseXML with DOM methods and send it back to the server
where a CGI script (or PHP or ASP or JSP) can save the XML as needed.

Of course it is als possible to use Microsoft.XMLHT TP with JScript in a
Windows Script Host file or an ASP page and there you can certainly save
to a file using the save method of the DOM document object (e.g.
httpRequest.res ponseXML).

--

Martin Honnen
http://JavaScript.FAQTs.com/

Jul 23 '05 #3


Mark wrote:

The javascript html is running on windows server 2000/windows 2000.
If the script were run in an ASP page on a server then certainly you
could call
xmlhttp.respons eXML.save(Serve r.MapPath('file .xml'));
but as below you use document.write it appears the script runs inside of
a browser and there you can't save to the local file system with normal
security settings.
If you want to be able to save to the local file system then on Windows
you can use a .hta file instead of .html file, that HTA runs like a
normal application so that script can then access the local file system.
document.write( xmlhttp.respons eText)

--

Martin Honnen
http://JavaScript.FAQTs.com/
Jul 23 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
3858
by: wkerplunk | last post by:
Below is what I have build with several different languages. It works great but I need help, I am stuck. When you click on an item in the dropdown autocomplete div it does a mousedown function and send the item number to the xmlHttp and works awesome. Now I need to add an apply button next to it. so they can type in the complete number then hit apply and it does the same function. I cant get it to work with the script I have. The image...
3
3474
by: SM | last post by:
Hello, Im trying to access elements in my XML file using the JavaScript DOM but i'm not sure how. I use AJAX to access the XML and then use the responseXML property to access the XML file data. I want to extract all the tracks from a specific CD. Right now, im using an array to stock all the data but its just a question of time before everything blows up because of the size of the array. Thats why im want to use an XML file (later i will...
0
1415
by: magister pips | last post by:
Hello, I have encountered some strange behaviour when using the XMLHTTP Request object in Javascript to return xml from a C# Webservice Method. I create a SOAP envelope and send it off to the Webservice, which I have debug points in, which when hit I can see that all the parameters are coming thru as null. I can't figure out why this is, any experts out there would be a great help. Here is my Javascript:
2
1760
by: Jaweed Sheikh | last post by:
Actually iam consuming a web service from traditional ASP and trying to read the XML from Javascript. Will appriciate any quick help. Here is the code <% If Request.ServerVariables("REQUEST_METHOD") = "POST" Then Dim xmlhttp Dim DataToSend DataToSend="cono="&Request.querystring("cono")&"&jobid="&Request.Form.Item("JOB_NO") 'DataToSend="cono=001&jobid="&Request.Form("JOB_NO") Dim postUrl, output
1
1578
by: hilather | last post by:
Hey Guys, Before I start I have searched the forums for similar threads and there are a few that sort of cover what I'm asking about, but I havent been able to fix my problem based on those threads and I'd rather not dig up dead topics. So heres my problem. I'm not really a web developer but I do know other programming languages. What I'm trying to make is a Firefox toolbar that can send a request to an HTTPS website and then scan it...
3
3034
by: VK | last post by:
On Apr 21, 1:54 pm, joe <m...@invalid.comwrote: http://www.jibbering.com/faq/index.html#FAQ4_18
2
12476
by: trpost | last post by:
Is it possible to execute javascript as passed in xmlHttp.responseText Here is what I am doing: search.js var xmlHttp xmlHttp=GetXmlHttpObject() var url="search.php" xmlHttp.onreadystatechange=stateChanged
6
20524
by: Bassem | last post by:
Hello everybody, I know it is an ordinary question, I tried a lot and searched but got nothing. I request another page (Default2.aspx) using JavaScript from (Default.aspx), get a response Response.Write() as a JavaScript then using document.write() to update the page. <script language="javascript" type="text/javascript"> var xmlHttpTopologyReceiver = GetXmlHttpObject(); function GetXmlHttpObject() { var xmlHttp = null; try ...
0
9716
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9595
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10604
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10354
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9177
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6870
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5536
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
3837
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3005
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.