onreadystatechange javascript event and Ajax threading

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.
LVL 3
Abdu_AllahAsked:
Who is Participating?
 
sunithnairConnect With a Mentor Commented:
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
 
Abdu_AllahAuthor Commented:
No, I mean ASP.NET thread.
0
 
sunithnairCommented:
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
Cloud Class® Course: Microsoft Azure 2017

Azure has a changed a lot since it was originally introduce by adding new services and features. Do you know everything you need to about Azure? This course will teach you about the Azure App Service, monitoring and application insights, DevOps, and Team Services.

 
Abdu_AllahAuthor Commented:
Is'nt there workaround to delay the html page to render until the thread finishs it's job?
0
 
sunithnairCommented:
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
 
Abdu_AllahAuthor Commented:
We use threading to improve the performance.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.