473,669 Members | 2,495 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

XmlHttp (Ajax) Show Waiting Message

Hi

I have a form that submits to a web service.
As this takes time, i would like to show the user a loading message while
its loading.
I am using XmlHttp to do the request
How can i show this waiting message.
No matter what i do, it waits till everythings loaded before doing anything.

Currently:

<SCRIPT language="javas cription">

function ButtonClick()
{
ShowLoadingMess age();
SubmitXmlHttpRe quest();
}

function ShowLoadingMess age()
{
document.getEle mentById('statu smessage').inne rHTML = 'Loading ...';
}

var xhttp;

function SubmitXmlHttpRe quest()
{
xhttp = new ActiveXObject(" Msxml2.XMLHTTP" );
xhttp.onreadyst atechange = GetXmlHttpResul t;
xhttp.open("GET ", http://mydomain.com/WebPageThatDoesProcessing,
false);
xhttp.send();
}

function GetXmlHttpResul t()
{
if ( xhttp.readyStat e == 4 )
document.getEle mentById('statu smessage').inne rHTML = 'Submitted';
}

</SCRIPT>

TIA
Jan 10 '06 #1
2 3786
for the browser to update the display it needs to run a windows look
(doevents). you go into a hard loop and prevent this. try:

function ButtonClick()
{
ShowLoadingMess age();
window.setTimeo ut("SubmitXmlHt tpRequest();",1 );
}

-- bruce (sqlwork.com)

"Grant Merwitz" <gr***@workshar e.com> wrote in message
news:O8******** ******@tk2msftn gp13.phx.gbl...
Hi

I have a form that submits to a web service.
As this takes time, i would like to show the user a loading message while
its loading.
I am using XmlHttp to do the request
How can i show this waiting message.
No matter what i do, it waits till everythings loaded before doing
anything.

Currently:

<SCRIPT language="javas cription">

function ButtonClick()
{
ShowLoadingMess age();
SubmitXmlHttpRe quest();
}

function ShowLoadingMess age()
{
document.getEle mentById('statu smessage').inne rHTML = 'Loading ...';
}

var xhttp;

function SubmitXmlHttpRe quest()
{
xhttp = new ActiveXObject(" Msxml2.XMLHTTP" );
xhttp.onreadyst atechange = GetXmlHttpResul t;
xhttp.open("GET ", http://mydomain.com/WebPageThatDoesProcessing,
false);
xhttp.send();
}

function GetXmlHttpResul t()
{
if ( xhttp.readyStat e == 4 )
document.getEle mentById('statu smessage').inne rHTML = 'Submitted';
}

</SCRIPT>

TIA

Jan 10 '06 #2
Thanks Bruce, i'll give that a try.

I had previously tried 'setTimeout',
but not 'window.setTime out'

"Bruce Barker" <br************ ******@safeco.c om> wrote in message
news:eP******** ******@TK2MSFTN GP12.phx.gbl...
for the browser to update the display it needs to run a windows look
(doevents). you go into a hard loop and prevent this. try:

function ButtonClick()
{
ShowLoadingMess age();
window.setTimeo ut("SubmitXmlHt tpRequest();",1 );
}

-- bruce (sqlwork.com)

"Grant Merwitz" <gr***@workshar e.com> wrote in message
news:O8******** ******@tk2msftn gp13.phx.gbl...
Hi

I have a form that submits to a web service.
As this takes time, i would like to show the user a loading message while
its loading.
I am using XmlHttp to do the request
How can i show this waiting message.
No matter what i do, it waits till everythings loaded before doing
anything.

Currently:

<SCRIPT language="javas cription">

function ButtonClick()
{
ShowLoadingMess age();
SubmitXmlHttpRe quest();
}

function ShowLoadingMess age()
{
document.getEle mentById('statu smessage').inne rHTML = 'Loading
...';
}

var xhttp;

function SubmitXmlHttpRe quest()
{
xhttp = new ActiveXObject(" Msxml2.XMLHTTP" );
xhttp.onreadyst atechange = GetXmlHttpResul t;
xhttp.open("GET ", http://mydomain.com/WebPageThatDoesProcessing,
false);
xhttp.send();
}

function GetXmlHttpResul t()
{
if ( xhttp.readyStat e == 4 )
document.getEle mentById('statu smessage').inne rHTML =
'Submitted';
}

</SCRIPT>

TIA


Jan 11 '06 #3

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

Similar topics

6
10449
by: Vanessa | last post by:
I have a question regarding async mode for calling Microsoft.XMLHTTP object. Microsoft.XMLHTTP hangs the IE once in a while suddenly, but it will work again after half an hour or so without doing anything. I have searched through the Internet and seems like the reason it hangs the browser it's because XMLHTTP limits you to two concurrent HTTP connections to each remote host; so if more than 2 concurrent connections strike the script...
1
4917
by: Ike | last post by:
Ive copied an online example for writing out a php file, programmatically, then would like to re-display that data in a browswer window that automatically refreshes as the data file (getdata.php, which is the file I am programmatically rewriting to elsewhere) gets changed. I am trying to use AJAX and JSON to do this. I have copied an example of using HttpRequest Object as the backbone of this from...
3
9555
by: Noozer | last post by:
Hrm.. last posting was mangled. Let's try again, with more detail... I'm just starting to try out "Ajax" web programming and I've got a question. AJAX is fairly straightforward. Javascript creates an XMLHttp object and then uses that to generate a hidden webpage with your results. What I'd like to know is, how can I retrieve multiple values from an XMLHttp request?For example, if my request generated an SQL query that returned a...
14
10006
by: FMDeveloper | last post by:
Currently transitioning from a shared host to a dedicated server. The same code that works on the old server is not working on the dedicated server. It is a simple AJAX request like: <code> function createXMLHttpRequest() { if (window.ActiveXObject) { xmlHttp = new ActiveXObject("Microsoft.XMLHTTP"); } else if (window.XMLHttpRequest) {
4
8272
by: sirjohnofthewest | last post by:
If I possessed the power to sway the mind of every user in the world to delete all forms of Internet Explorer I would die a happy man. Hi guys, I frequently visit this site to get answers to my problems and this one is really getting to me... I have a page that allows you to Browse Authors. There are three drop down boxes that auto-populate via AJAX. I have a file which it calls and returns the dynamically built XML file in the boxes...
1
9011
by: farghal | last post by:
Hello as many people I'm new to ajax but trying my best to understand. At this point I got a problem I'm not able to solve. I've looked on several forums and googled internet but I can't find a solution :S. This is the basic idea: I'm trying to implement Ajax in a Portal page created in weblogic 9.2. I've created a portlet with the name Ajax.jsp and an additional page called test.jsp. Ajax.jsp is the main portlet page. And uses the...
2
3291
by: Jay | last post by:
Getting into AJAX using the XMLHttp object and am really liking it. We are in the process of upgrading our existing behavior calls (webservice.htc) to the more 'supported', as they say, concept of AJAX. One thing I noticed was that the .htc code practically does the same thing AJAX does - with nice code that allows you to .value reference the return XML nice and easily - and now I'm wondering why I should even bother trying to reinvent...
21
3821
vikas251074
by: vikas251074 | last post by:
I am getting error while entry in userid field. When user enter his user id, an event is fired immediately and user id is verified using AJAX method. But I am getting error 'Object doesn't support this property or method'. <form name="myform" action="main.asp" method="post"> <div id="content"> <h2 id="pageName">Main Page</h2> <div class="feature"> <h1>Surfing the intranet </h1> <p> This is a comprehensive information...
1
1490
by: StevenS | last post by:
Ok, I'm very new to AJAX programming, and fairly new to Javascript. (I was originally trained on low-level C programming.) I'm trying to build a simple AJAX routine in a file named ajax.js: var xmlReqs = new Array(); function CXMLHttp(cb,data,xmlHttp) { this.cb = cb; this.data = data; this.xmlhttp = xmlHttp; }
0
8384
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
8896
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...
1
8590
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7410
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...
1
6211
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5683
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
4208
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...
0
4387
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
1790
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.