lema Posted November 9, 2012 Share Posted November 9, 2012 As a classic old-fashion programmer , I learnt to develop with the procedural approach in mind. I try to adapt into the web - asynchronous model , and in most cases I don't have any problem. But , there are times that I want to block the program flow until some javascript function return a value. Is there any possibility to achieve that? Quote Link to comment Share on other sites More sharing options...
stlcours Posted November 18, 2012 Share Posted November 18, 2012 use callback, see demos Quote Link to comment Share on other sites More sharing options...
lema Posted November 18, 2012 Author Share Posted November 18, 2012 I really do have a problem with that. I have already used any method I know off without any success. Could you please give me a hand? All I want is to execute a javascript snippet on the server and wait (block the program flow) until the response comes. Quote Link to comment Share on other sites More sharing options...
Administrators Farshad Mohajeri Posted November 25, 2012 Administrators Share Posted November 25, 2012 All I want is to execute a javascript snippet on the server and wait (block the program flow) until the response comes. JavaScript execution can never be blocked. You can set a timer and poll response, but it is a whole different story. Quote Link to comment Share on other sites More sharing options...
lema Posted November 25, 2012 Author Share Posted November 25, 2012 Hi, Farshad. Thank you for your reply. OK , I (fully) understand that position. I know , I must change my WIN32 programming style and start thinking as a web developer. In the following post: http://forums.unigui.com/index.php?/topic/1977-performance-and-questions-in-production/page__p__8820#entry8820 you wrote that you can add a mode which UI is blocked after each Ajax request. Do we have any luck to see it in the near future?? If your events are synchronous the only way is to block UI until each event is fully processed. There is no other way. There is no way for framework to handle this situation internally. Of course, we can add a mode which UI is blocked after each Ajax request. This will reduce UI experience quality but you need it if your app is designed and works synchronously. If one event can't be executed more than once you need to protect it using client side UI masking techniques.... Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.