In my JS file I have two functions:
function A () {
...
$.ajax({
type: "POST",
url: "page.php",
data: {<some data>}
})
.done(function( data ) {
...
})
...
}
function B () {
...
$.ajax({
type: "POST",
url: "page.php",
data: {<some other data>}
})
.done(function( ) {
...
})
}
Both these functions are called by onclick event of some anchors. So, somewhere in html file I have such code:
<a onclick="A()">Link to call A()</a>
<a onclick="B()">Link to call B()</a>
When I have only function A in my code everything works just fine. However, these functions both doesn't work when I have them in the code that you can see above. When I click on a link with onclick="A()" function A is not even called.
What is wrong? How can I fix it?