Free Support Forum - groupdocs.com

Synchronous Requests?


#1

Is there a reason your javascript code makes synchronous ajax calls? Is that really necessary?



Is there a way to stop that from happening?



Happens in GroupdocsViewer.all.min.js.


#2

Hello Matt,

Unfortunately it is unclear for us what you want to achieve, what is your goal, why you need this? Can you please describe your use case, your scenario, why synchronous AJAX calls are not suitable for you?

Thanks and waiting for your reply.


#3

All my code (HTML) is generated during runtime. Synchronous calls stop everything else I am attempting to do during load time.



The simple use case I have setup does seem to be working but I worry about more complicated screens causing problems when everything stops dead waiting for your calls to comeback.



It also leaves console messages saying " Synchronous XMLHttpRequest on the main thread is deprecated because of its detrimental effects to the end user’s experience."



Thats hardly inspiring messages for a client to see when code is delivered to them.



So I ask again. It is really necessary to make synchronous ajax calls?



Thanks!!


#4

Hello Matt,

Thank you for answering. We’ve contacted developers and they’ve answered that GroupDocs.Viewer uses the asynchronous AJAX requests. So, please, tell us, how did you find out that AJAX requests are synchronous? Maybe, you use some specific configuration? Perhaps you are using your own modified or customized version of jQuery on the web-page where GroupDocs.Viewer widget is situated, or some other scripts. Can you reproduce such scenario on a distinct empty web-page where only JavaScript libraries from the GroupDocs.Viewer package are used?

Thanks and waiting for your reply.


#5

In the file GroupdocsViewer.all.min.js i can see 5 instances of ajax calls where this code is set “async:false”. And another instance where async is set using a variable.



I only see that console message above once so one of these calls is being made and is synchronous.



My jQuery version is directly downloaded from jquery site. It is not custom and every ajax call i make in the code has async explicitly set as true.


#6

Seems the GetScript calls are going as async false.


#7

Hello Matt,


We are sorry that you have such issue. Our dev. team works on resolving this issue. We will notify you in this thread when it will be ready.

Sorry for the inconvenience.

#8

Hello Matt,

Sorry for the delay with the answer.

The GetScript calls are not the AJAX calls. When you declare a <%=Groupdocs.Web.UI.Viewer.CreateScriptLoadBlock()…%> in the HEAD block, this statement is transformed into the standard inclusion block like “” and so on.

About the main question. Yes, you are right, the GroupdocsViewer.all.min.js contains five synchronous AJAX calls. But these parts of source code are never used - this is obsolete or disabled code, which is not used in the current versions of the GroupDocs.Viewer in any cases.

We will get rid of such obsolete code in the future versions of the GroupDocs.Viewer.

Thanks.