Forum Discussion
_anomDiebolt_
7 years agoQrew Elite
>works perfectly now!
Please take no offense but the code you posted uses outdated constructs from a decade ago:
(1) you are making multiple (a dozen) API calls when only one call to API_ImportFromCSV is needed
(2) you are using synchronous API calls when you should be making asynchronous calls
(3) you are using XMLHttpRequest to make API calls when you should be using jQuery's AJAX methods or the fetch API
(4) Modern JavaScript rarely uses raw for loops - instead it uses functional methods such as each(), map(), filter(), reduce()
(5) There is no good reason to use prompt() when more modern dialog boxes can be accessed through jQueryUI which is already loaded on the page
Over the weekend I will create a couple of simple examples that will show you how to modernize and greatly simplify your code.
Please take no offense but the code you posted uses outdated constructs from a decade ago:
(1) you are making multiple (a dozen) API calls when only one call to API_ImportFromCSV is needed
(2) you are using synchronous API calls when you should be making asynchronous calls
(3) you are using XMLHttpRequest to make API calls when you should be using jQuery's AJAX methods or the fetch API
(4) Modern JavaScript rarely uses raw for loops - instead it uses functional methods such as each(), map(), filter(), reduce()
(5) There is no good reason to use prompt() when more modern dialog boxes can be accessed through jQueryUI which is already loaded on the page
Over the weekend I will create a couple of simple examples that will show you how to modernize and greatly simplify your code.