Win a copy of Testing JavaScript Applications this week in the HTML Pages with CSS and JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
  • Piet Souris
  • Frits Walraven
  • Carey Brown

How to fetch data with Ajax?

Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Tony Ghy wrote:But for this case, I don't want to fetch all the data in some JSON at a go. If the user clicks on the 'more details' link, it should fetch the Ajax seems better in this case. What say?

I have the same problem here. I am just beginner and do not have knowledge of AJAX or JSon. Will you please guide me how fetch the data using AJAX.
Posts: 67424
Mac Mac OS X IntelliJ IDE jQuery Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the Ranch.

Writing up a whole tutorial on Ajax isn't appropriate for a forum post, but there are plenty of Ajax tutorials online.

However, it doesn't really make sense in 2018 to use the low-level Ajax API in your code. I'd advise adopting jQuery if you are not going to be using any other JS framework. It not only vastly simplifies Ajax, but also other knotty areas of JavaScript (DOM manipulation, event handling, etc).

If all you want is just Ajax assist, consider axios which only provides a higher-level Ajax API.
If you two don't stop this rough-housing somebody is going to end up crying. Sit down and read this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
    Bookmark Topic Watch Topic
  • New Topic