I have a script (not Nodejs ) in which there are a lot of ajax requests. All this works well, except that after 3000 the browser crashes. (optional after 3000. this is for example.)
And I have a question. Is it possible to somehow run the script outside the browser? Better yet, run in a browser, but execute outside the browser.
What I already did:
- Use
async:false. Everything works fine, but the interface of the page is freezing, and requests are executed quite slowly. I also think that when using callbacks instead ofasync:false, the script execution will remain the same. The interface will probably remain working, but the speed will remain the same and this will make the coding much harder for me. - Using the headless browser . I tried to use the Rhino engine in the console under Windows . I rewrote the code for this case, but he began to produce such a number of errors (and quite insignificant when executing the code in the browser), that after, somewhere, 15 I gave up on this method with my hand. I used Rhino with Envjs and jQuery ).
- Packing Javascript in a Windows application. I tried, but it's not at all.
The structure of the code now looks like this:
$.ajax({ url: "ajax/example.php", success: function(data){ $.ajax({ url: "example.php", success: function(data){ }); }, complete: function(){ $.ajax({ url: "example.php", success: function(data){ }); } ); I do not intend to rewrite code on Nodejs or any other language. And I almost forgot, Firefox browser (maybe needed). The system is pretty weak. The error generated when the browser is more beautiful is related to jquery.js, respectively.
связана с jquery.js. And on the topic, why do you use so many requests, what is their role? - Vasily Barbashev