473,795 Members | 3,063 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

IE page rendering issue (Wait message)

tusovka
23 New Member
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 4691
tusovka
23 New Member
Gits,

I will be back at work on Monday and will apply new changes to the code then. I will post the new results then.

Thanks for your time.
Tusovka
May 16 '09 #21
gits
5,390 Recognized Expert Moderator Expert
no problem :) ... i'll have a look at it then :) ... have a nice weekend ...

kind regards,
gits
May 16 '09 #22
tusovka
23 New Member
Gits,

Well I modified the code as you mention in the previous post.

Expand|Select|Wrap|Line Numbers
  1.  
  2.  oRequest.open(\"GET\",sURL,true);     //used to be false !!!
  3.     oRequest.setRequestHeader(\"User-Agent\",navigator.userAgent);
  4.     oRequest.send(null)
  5.  
  6.     oRequest.onreadystatechange = function() {
  7.       if( oRequest.readyState == 4 ) {
  8.         //response is ok
  9.         if( oRequest.status == 200 ) {
  10.           //alert( oRequest.responseText );
  11.           return(oRequest.responseText);
  12.         } else {
  13.           alert(\"Error executing XMLHttpRequest call!\");
  14.         }
  15.       }
  16.     }
  17.  
  18.  
Well I know the last alert never executes so that good news. Unfotunatly, both FireFox and IE both behave the same now. The output is: instantaneous population of the <span> container with a message ( undefined ) instead of a selector.

Please note I inserted the return( ) myself because if was not mentioned where that line of code should go.
May 18 '09 #23
tusovka
23 New Member
Gits,

As I was examining the (https://developer.mozilla.org/En/Using_XMLHttpRequest) web page you recommended I found a few varibles I though might me effecting my program.

In the online example:

Expand|Select|Wrap|Line Numbers
  1.  var req = new XMLHttpRequest();  
  2.  req.open('GET', 'http://www.mozilla.org/', true);  
  3.  req.onreadystatechange = function (aEvt) {  
  4.    if (req.readyState == 4) {  
  5.       if(req.status == 200)  
  6.        dump(req.responseText);  
  7.       else  
  8.        dump("Error loading page\n");  
  9.    }  
  10.  };  
  11.  req.send(null); 
note the function takes a variable!, mine does not? also the (;) at the end of the function definition. I tried adding the (;) still same behavior. Also the use of dump() instead of return. Finally the send(Null) is at the end of all of this.

I'm not sure why the difference, but thought I should mention what I have noticed.

My pevious post is not posted yet, (Waiting to be approved).
May 18 '09 #24
acoder
16,027 Recognized Expert Moderator MVP
The function doesn't need a parameter and the semi-colon is not required.

Move the send to the end. dump() is a user defined function. Your return isn't quite correct, because what does it return to. I would suggest that you change your code where you have:
Expand|Select|Wrap|Line Numbers
  1. var techinfo=techPage(A, B, C, D);
  2. document.getElementById('tech_selector').innerHTML=techinfo; 
and change that to use the response to set the tech selector, e.g.
Expand|Select|Wrap|Line Numbers
  1. document.getElementById('tech_selector').innerHTML=oRequest.responseText; 
in place of the return.
May 19 '09 #25
tusovka
23 New Member
I would like to thank everyone who gave advice and made it possible for me to figure out this task. Finally, I got the query message to display in both FF and IE.

First, something that is not seen here is a small php code that goes in to my tech.php page. Right after I decipher the URL and pull out the needed variables, the next thing i do is a ---> flush(); <---.

Now, going back to my JavaScript function : techPage()
1) Note, I'm using the code snippet (Git's) recommended a couple of post above. -->oRequest.statu s == 200 and the readyState == 4....

2) I implemented the idea (Acoder) recommended and got rid of the return, and actually loaded the span right here instead of later in my code. But, just to make a note the return worked, how I'm not sure. I still made the change just because it made my code simpler to understand (I think).

3) Note that im actually turning on and off the message here instead of another embedded location.

4) Finally the readyState ==2 was the trick that made it all work.

So it works... Thanks for all your help...


Expand|Select|Wrap|Line Numbers
  1.  
  2. function*techPage(A, B, C, D, E, F)*{ 
  3.     var*oRequest*=*new*XMLHttpRequest();
  4.     var*sURL=*\"http://\"+self.location.hostname+E+D+\".php?A=\"+A+\"&B=\"+B+\"&F=\"+F; 
  5.         //alert(sURL); 
  6.         //document.write(sURL); 
  7.     oRequest.open(\"GET\",sURL,true); 
  8.     oRequest.setRequestHeader(\"User-Agent\",navigator.userAgent); 
  9.     oRequest.send(null) ;
  10.  
  11.     oRequest.onreadystatechange = function() {
  12.           if( oRequest.readyState == 4 ) {                                                        //transaction is complete (4)
  13.         document.getElementById('wait_message').style.display='none';     //message OFF
  14.                 if( oRequest.status == 200 ) {                                                //HTTP statues OK
  15.                       document.getElementById('tech_selector').inner HTML=oRequest.responseText;     
  16.                   } else {
  17.                       alert(\"Error executing XMLHttpRequest call!\");
  18.                 }                                                                                      
  19.           }
  20.     if( oRequest.readyState == 2 ) {                                                        //loaded = 2
  21.         document.getElementById('wait_message').style.display='';
  22.         //during this state display the message (ON)
  23.     }
  24.     }         //end of function()
  25. }                    //end of techPage()
  26.  
  27.  
May 20 '09 #26

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

Similar topics

7
1863
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?
5
11043
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...
2
2103
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
2
3631
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
10
2210
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/
2
1588
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...
0
1227
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"...
2
4909
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
14
23171
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...
0
9672
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
9519
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
10213
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...
1
10163
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
9040
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
7538
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
6780
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
5563
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3722
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.