473,408 Members | 2,535 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,408 software developers and data experts.

Posting in the background - getting html response?

1
How do I post to a server in the background and capture the html it spits back? This code re-driects to the server:

Expand|Select|Wrap|Line Numbers
  1. function go() 
  2. {
  3. document.cps.action = "http://remote_server_URL:PORT" 
  4. document.cps.submit();
  5. }
  6.  
...and using the XMLhttp method below gives me a server timed out error:

Expand|Select|Wrap|Line Numbers
  1. function go2() {
  2.  
  3. var oXMLHTTP = new ActiveXObject( "Microsoft.XMLHTTP" );
  4. var shipinfo = escape(itemlist);    
  5. var sURL = ("http://206.191.4.228:30000?XMLRequest=" + shipinfo);
  6. document.writeln(sURL);
  7. oXMLHTTP.open( "POST", sURL, false );
  8.  
  9. oXMLHTTP.send();
  10.  
  11. document.writeln(oXMLHTTP.responseText);
  12.  
  13. }
  14.  
Any suggestions or methods to accomplish this? Please? It is basically a hidden form that posts XML data (one hidden tag in the form) and receives an answer to the data as HTML (a table) which is to be displayed.

Thanks,
JMR
Sep 1 '05 #1
1 2685
acoder
16,027 Expert Mod 8TB
You can't use document.writeln after the page has loaded.

When using POST, the parameters should be sent using the send method - see a basic AJAX example.
Oct 1 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

15
by: Holly | last post by:
I'm trying to get this page to look the same in Netscape and IE. I have a box that says 'Upcoming Events' on the lower left of the page. It's supposed to have a gray background, but in NS 4.x it...
6
by: Michael Rozdoba | last post by:
I've had some trouble getting IE to behave in respect of applying absolute positioning to a span on an a:hover. I can get it to work, but I don't understand why certain code causes it to fail to...
1
by: Mike | last post by:
I want to change the background image of the html page within code based on the users selection. I'm trying to use this in the page onload even response.write("<body background=' & dataitem>") ...
11
by: Steve Kirkendall | last post by:
I need a work-around for an IE limitation, regarding fetching HTTP documents in the background. It takes a bit of explaining; please be patient... I'm working on an project that will run on an...
2
by: Esa | last post by:
Hi, I'm having problems with one strange web system where submitting an application and making queries about its handling status require a series of form submits and response parsing - all in...
0
by: Jeb Hunter | last post by:
Well, how can I describe this succinctly? I have a page with DIVs that us background images to produce a border effect. It works perfectly well, but I want to make up (for now) 3 different...
2
by: darkpowrjd | last post by:
I've been trying to create a new navigation system for my site, and I got everything figured out except for one thing. Here is the CSS code I'm using right now: body { font: normal 10px Verdana,...
2
by: yogarajan | last post by:
hi i have create one html file. That file contains background image . but print preview time not display . i am go to tools -> internet options-> advanced options -> printing -> print background...
10
by: surpavan | last post by:
Good afternoon i am a newbe.. I have tried to create a small site with the following code: However, the problem that I am facing is because the color white that was given in upper element...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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...
0
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,...
0
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...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
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,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
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...

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.