Answer the question
In order to leave comments, you need to log in
Should you use Ajax?
Since I don’t really like constant page reloads, I use ajax (JS / jQuery) wherever possible in my intranet php projects - form validation, form submission, etc. - everything works fine.
The question is - can there be any difficulties with this approach when the load on the site increases?
And are there any downsides in the future (except for the option that js can be disabled on the client)?
Thank you.
Answer the question
In order to leave comments, you need to log in
And why then not make a SPA and use 1 from a bunch of js frameworks for this, and leave only api for this SPA in php.
The ajax load characteristics are even better. Disadvantages, apparently known to you:
- poorly indexed by search robots
- in critical places, another source of unreliability. A simple http request may or may not succeed and return an error. ajax request returns only a promise, the open page of say the financial system will work, the buttons will be pressed and if contact with the server is lost, you can lose consistency.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question