Because Firefox and IE render web pages differently, I cant get the same results.
I working with many embedded tables that contain javascript functionality inside.
What I have is a table that contains radio buttons. Once the user selects a button, I use the onClick functionality to generate 2 dynamic selectors that are inserted once results come back from DataBase.
I want to display a simple message (Query in progress) until the selectors are generated (2sec). To display the message:
document.getEle mentById('waitQ uery').style.di splay='';
and once the selectors are build remove message:
document.getEle mentById('waitQ uery').style.di splay='';
This works in Firefox, but not in IE. Why, because the table is not complete, that is the selectors are not done yet. So IE does not show the message either. Once the selectors are created, IE executes the Javascript, but so fast that message is not seen, plus in does not make sense to show the message after the wait time passed.
Please, help... I just want a simple message to be Displayed in IE while query in progress...
May 12 '09
25 4690 gits 5,390
Recognized Expert Moderator Expert
you find a quick intro here and here ... at the bottom of the page there are more links that could get you on track ...
kind regards
Frinavale 9,735
Recognized Expert Moderator Expert @gits
Yes it was a question (note the question mark) :)
I should have probably just researched it....but was lazy yesterday.
gits 5,390
Recognized Expert Moderator Expert
yes ... i know and i misunderstood it as a question for whether the OP would use AJAX or not and as it turned out now he isn't at the moment ... so that would explain the behaviour of the browser ... :)
For some reason I could not post a reply. So if later you see 3 same replies just ignore.
I located the XMLHttpRequest( ) function. -
function techPage(A, B, C, D, E, F) {
-
var oRequest = new XMLHttpRequest();
-
var sURL= \"http://\"+self.location.hostname+E+D+\".php?A=\"+A+\"&B=\"+B+\"&F=\"+F;
-
//alert(sURL);
-
//document.write(sURL);
-
oRequest.open(\"GET\",sURL,false);
-
oRequest.setRequestHeader(\"User-Agent\",navigator.userAgent);
-
oRequest.send(null)
-
if (oRequest.status==200) {
-
return(oRequest.responseText);
-
//alert(oRequest.responseText);
-
} else {
-
alert(\"Error executing XMLHttpRequest call!\");
-
}
-
}
----
Any suggestions on what my next step could be in finding a solution to my message issue in IE???
Frinavale 9,735
Recognized Expert Moderator Expert @tusovka
Hehe, yeah I cleaned up your duplicate posts.
The reason your reply wasn't showing up is because your post contained code that the forum filter thought could be dangerous. One way to avoid this problem is to post your code in code tags... but some posts are filtered even with code tags. If it happens again just contact a moderator and they'll fix it for you :)
acoder 16,027
Recognized Expert Moderator MVP
To make it asynchronous, change line 6 to: - oRequest.open(\"GET\",sURL,true);
@acoder
I tried changing the 3rd argument to (true) from false and my code fails. I still dont know why.
gits 5,390
Recognized Expert Moderator Expert
yes ... you don't use a callback since you rely currently on a sync process ... try the following in addition to the true-param: - oRequest.onreadystatechange = function() {
-
if (oRequest.readyState == 4 && oRequest.status == 200) {
-
return(oRequest.responseText);
-
//alert(oRequest.responseText);
-
} else {
-
alert(\"Error executing XMLHttpRequest call!\");
-
}
-
}
kind regards
Here is the output:
1)First, the tech selector <span> displays --> undefined
2)Second, I get the alert message -->
(Error executing XMLHttpRequest call!) -
-
function*techPage(A,*B,*C,*D,*E,*F)*{
-
****var*oRequest*=*new*XMLHttpRequest();
-
****var*sURL=*\"http://\"+self.location.hostname+E+D+\".php?A=\"+A+\"&B=\"+B+\"&F=\"+F;
-
****//alert(sURL);
-
****//document.write(sURL);
-
****oRequest.open(\"GET\",sURL,false);
-
****oRequest.setRequestHeader(\"User-Agent\",navigator.userAgent);
-
****oRequest.send(null)
-
****
-
oRequest.onreadystatechange = function() {
-
if (oRequest.readyState == 4 && oRequest.status==200) {
-
return(oRequest.responseText);
-
//alert(oRequest.responseText);
-
} else {
-
alert(\"Error executing XMLHttpRequest call!\");
-
}
-
}
-
}
-
I also tried to un-comment --> //alert(oRequest. responseText);
and I also see this alert. That mean, its as if both parts of the code are executed. The ( if) and (else). There is a good possibility I pasted the code in the wrong part.
Any suggestion are appreciated !
gits 5,390
Recognized Expert Moderator Expert
ok ... the error alert appears since the readyState changes sometimes from 1 to 2 to 3 to 4 ... while 4 states that the request is complete, so change the code a bit: - // callback when readyState changes
-
oRequest.onreadystatechange = function() {
-
// request is complete
-
if (oRequest.readyState == 4) {
-
// response is ok
-
if (oRequest.status == 200) {
-
alert(oRequest.responseText);
-
} else {
-
alert(\"Error executing XMLHttpRequest call!\");
-
}
-
}
-
}
additionally in the open-method the 3rd param should be true.
what does the alerts say now?
kind regards
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: lawrence |
last post by:
This page renders slowly on both IE and Netscape - everything
downloads before anything appears on screen. It is the behavior you'd
expect if the whole thing was wrapped in a table, yet there is no
table. What other sorts of problems normally cause this?
|
by: Rick Spiewak |
last post by:
I need to generate a "buy" button as part of an ASP.NET page - this consists
of a small HTML form with hidden fields, conforming to the requirements of a
merchant credit card processor. PayPal is similar.
I'm succeeding in doing this by using Writer.Write to emit my HTML, at least
as far as getting it to work.
However, depending on where I put MyBase.Render(Writer), I get my HTML
either before the header or after the end of the body of...
|
by: Bill Hauver |
last post by:
I am attempting to display a web page which simple
displays a 'Please wait, generating report...' message
before I redirect a user to another web page. I can't
figure out where to put the redirect code because
the 'please wait' page doesn't render to the client
browser (the message is never displayed before the
redirect). Any suggestions would be most helpful!
Thanks - Bill
|
by: John Lau |
last post by:
Hi,
Is there documentation that talks about the page lifecycle, the lifecycle of
controls on the page, and the rendering of inline code, in a single
document?
Thanks,
John
|
by: Nathan Sokalski |
last post by:
One thing that I have often needed to do that I have been unable to find a
way to do is refresh the page (basically do the same thing as pressing the
browser's Refresh button). I know how to do this using Javascript/JScript,
but I have situations in which I need it to be done immediately after code
that is part of my other code. Is there any way to do this? Thanks.
--
Nathan Sokalski
njsokalski@hotmail.com
http://www.nathansokalski.com/
| |
by: Brent |
last post by:
Like many sites, mine has a standard "look" -- a template, if you will
-- that visitors see on each page. I've tried to keep the code and HTML
separate to the extent possible, and for most standard page
presentations, it works well.
However, I have a couple of screen scrape / import routines that can
take minutes, even hours, to complete. I'd like to have some way of
outputting my template first to the browser, and then within the...
|
by: Ambush |
last post by:
My aspx is called from an ASP page. I process the request and then
call another ASP page with a few hidden inputs. Currently, when the
page processes, the user is complaining that my code is running too
fast and that my "Please Wait" page flashes by too quickly. I can't
put an inline wait/sleep command, as the page doesn't refresh until the
code is done running. I've tried using a:
<meta id="mtaRefresh" http-equiv="refresh"...
|
by: Crirus |
last post by:
I made a simple test... loaded an image from file and draw it on a form
In mouse move, I just refresh the form.... that cause 1 000 000 page faults
(as task manager shows) in less than a minute.. what is that?
--
Ceers,
Crirus
------------------------------
If work were a good thing, the boss would take it all from you
|
by: lmttag |
last post by:
Hello.
We're developing an ASP.NET 2.0 (C#) application and we're trying to
AJAX-enable it. We're having problem with a page not showing the page while
a long-running process is executing. So, we're looking for a way to display
the page with a "please wait..." message while the process is running, and
then, when the process is done, update the page with the actual results/page
content.
We have a page that opens another browser/page...
|
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...
|
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...
| |
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,...
|
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
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...
|
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();...
|
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...
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
| |
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |