4
I have a list of buttons (<li>
):
<li id="1">link 1</li>
<li id="2">link 2</li>
<li id="3">link 3</li>
<li id="4">link 4</li>
<li id="5">link 5</li>
When the user clicks on a link he executes a Ajax and make a request in one PHP file, when you click on another, it makes the same request and so on.
I would like to know how to do when the user clicks on link and only on the first click make the request and if it click again do not make the request anymore.
PS.: When he clicks on any of the links, it executes the event html()
that keeps the results in a div that is right next to the <li>
How are you currently doing? There are many ways, the question is to choose one that fits well in the rest of your code...
– mgibsonbr