Topic: Load a section of a page only from PHP API

Mackenzie priority asked 4 years ago


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.) enter image description here


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



Please insert min. 20 characters.

FREE CONSULTATION

Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.

Status

Answered

Specification of the issue

  • ForumUser: Priority
  • Premium support: Yes
  • Technology: MDB jQuery
  • MDB Version: 4.19.0
  • Device: desktop
  • Browser: firefox
  • OS: win
  • Provided sample code: No
  • Provided link: No