0

I'm new to JS, new to PHP and fairly new to SQL and I'm trying to figure out how AJAX works. What I've found so far is that I have to write a bunch of code for each little thing I want to do with AJAX, as all the examples define the .php-file that should be executed in the base code.

I've been trying to find a way where the core AJAX functionality is written in a .js-file and where I can pass the file name of the php-file that I want to use as a variable, in the end, ending up with something like this:

<input type="button" onclick="myAJAXcall(getusers.php)" value="Get users">

Can this be done? How do I do it? Been searching the web for a long time, and cannot find an example even that I can use.

0 Answers0