I been seening ajax all over the place.
The only time I have used is in the news feeds script
I got from dynamic drive.

The first question I have, is do you need to have
a database dns sort of thing to be able to begin
learning it.

Where can I find simple ajax code to hack around on.
I learn more about syntax and sub routines. By experimenting.

So if i could start on something simple. Let me know.
I know some css javascript and a tad of xml.

Dani AI

Generated

asked for a simple, practical way to learn AJAX. Start with a tiny, local experiment that requests a small file and updates the DOM. No database or DNS is needed for early practice: static files served over HTTP are enough. As noted, AJAX is the client-side technique for requesting and showing data; the server can be as simple as a single JSON file.

A minimal workflow:

  • Create an index.html with a placeholder element (for example, a <ul id="items">).
  • Create data.json with a small array of items.
  • Serve the folder with a simple HTTP server (browsers block many requests from file://).
  • Use the Fetch API to request data.json and inject results into the page.

Example fetch code to paste into a script tag in index.html:

fetch('data.json')
  .then(response => {
    if (!response.ok) throw new Error(response.statusText);
    return response.json();
  })
  .then(data => {
    document.getElementById('items').innerHTML =
      data.items.map(i => `<li>${i}</li>`).join('');
  })
  .catch(err => console.error('Fetch error:', err));

Troubleshooting notes: run a local server (for example python -m http.server 8000), watch the Network and Console panels in DevTools, and check CORS errors when requesting cross-origin resources. Modern projects favor JSON + Fetch; older examples use XMLHttpRequest or JSONP for legacy cases.

Further reading (concise, practical): Using Fetch and the MDN CORS overview Cross-Origin Resource Sharing.

A great tutorial on AJAX can be found at Google
AJAX doesn't involve databases - its more of a way to display data that's already been retrieved from a server (which may, then, involve database access).

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.