php - Should I use AJAX or get every data beforehand -


I have a web app where I need to change a drop down list dynamically based on a drop down list is.

I have two options: Get all data from PHP first and later it should get "data" with Javascript or AJAX to get the data

This is the thing that by default, the page loads with all the data and the user can select a sub category later to narrate the drop down.

Which of the two options are better (faster, less resource intensive)?

If there is a considerable number of potential selection options, then I can use AJAX to get them dynamically Use if you have only a very small group of selection options, it would be appropriate to consider embedding them in the page. Embedding in the page does not mean any delays, and is a snapper interface.

However, as previously mentioned, dynamic retrieval is very useful if you have large options, or if the options change dynamically.

With any AJAX request, remember to display some form of visual feedback when the request is running.


Comments

Popular posts from this blog

windows - Heroku throws SQLITE3 Read only exception -

lex - Building a lexical Analyzer in Java -

python - rename keys in a dictionary -