Solved

onreadystatechange javascript event and Ajax threading

Posted on 2009-04-03
6
405 Views
Last Modified: 2012-05-06
Hi, in the regular cases the onreadystatechange event fired when Ajax request for a page x has been done , but in our case we want to use threading in that page  ( page x) but in this case onreadystatechange event fires when that page(page x) has finished executing not when the thread in that page has finished, so how we can fire onreadystatechange when the thread has finished not the page.
Help please.
0
Comment
Question by:Abdu_Allah
  • 3
  • 3
6 Comments
 
LVL 16

Accepted Solution

by:
sunithnair earned 500 total points
ID: 24058824
What do you mean by thread? Is that ASP.NET thread you mean or just Javascript using setTimeOut or something like that? I am afraid you will not be able to do both of that I suppose because onreadystate change is fired when the whole of HTML has been rendered (same like when the browsers show "Done" message in the status bar.)
0
 
LVL 3

Author Comment

by:Abdu_Allah
ID: 24058918
No, I mean ASP.NET thread.
0
 
LVL 16

Expert Comment

by:sunithnair
ID: 24059030
You will not be able to do that anyway as I said before. Check this link if you need more info on onreadystatechange http://www.w3schools.com/ajax/ajax_xmlhttprequest.asp
0
Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

 
LVL 3

Author Comment

by:Abdu_Allah
ID: 24059468
Is'nt there workaround to delay the html page to render until the thread finishs it's job?
0
 
LVL 16

Expert Comment

by:sunithnair
ID: 24059649
That is the real purpose of threading to have the page processed when something else is processed in the background. Why are you using the Thread for? If you remove the threading the page will process as your requirement.
0
 
LVL 3

Author Comment

by:Abdu_Allah
ID: 24060475
We use threading to improve the performance.
0

Featured Post

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The Confluence of Individual Knowledge and the Collective Intelligence At this writing (summer 2013) the term API (http://dictionary.reference.com/browse/API?s=t) has made its way into the popular lexicon of the English language.  A few years ago, …
JavaScript can be used in a browser to change parts of a webpage dynamically. It begins with the following pattern: If condition W is true, do thing X to target Y after event Z. Below are some tips and tricks to help you get started with JavaScript …
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

815 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now