Topic: Load a section of a page only from PHP API
Expected behavior I conduct searches and click buttons and a column reloads the content without having to reload the full page. Actual behavior whole page reloads because data is fetched from API (another site) so can't use $(load) method. Resources (screenshots, code snippets etc.)
Krzysztof Wilk staff answered 4 years ago
Hi!
Which technology do you use to fetch your API? If you are using PHP - I think that's because of server-side rendering (the whole page must reload after the data refreshes). If you are using JavaScript / jQuery - you can pass the Event object to your select handling function and use event.preventDefault()
method to avoid refreshing. Another idea for this case is to use AJAX.
Best regards
FREE CONSULTATION
Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.
Answered
- User: Pro
- Premium support: Yes
- Technology: MDB jQuery
- MDB Version: 4.19.0
- Device: desktop
- Browser: firefox
- OS: win
- Provided sample code: No
- Provided link: No