Why is not it working?
In the snippet where you are using load(url)
, I imagine you expect it to access the url
you provided, and when the execution gets there you finish solving things. However, load(...)
in your code causes javascript
to understand that there is a function called load
, such as function load(url){...}
created or imported by you at some point. At jQuery
the correct would be to use the $.load()
[+] function assigned to some element in its HTML
, for example: $("body").load(url)
. See here the statement is different from the way you tried on your first attempt.
Here is the solution
The jQuery
provides the $.get
function [+] and $.post
[+] , which are no more than shortcuts to $.ajax(...)
[+] which allows you to execute access to a url
by its javascript
code. This function is unique to jQuery
, which can be downloaded by here .
If you test, you will see that $.load
works equal $.get
. The jQuery
documentation explains how to use both forms. $.load
is assigned to some element in the structure that will receive the execution response of url
, $.get
will depend on you will want to handle the execution response of url
.
The implementation in your code will be:
<script type="text/javascript">
function removemen(id)
{
var url = 'functions/atumensainbox.php?id_del=' + id;
$.get(url, function(retorno){
/* aqui o tratamento de alguma retorno que o final da execução da sua url fornece*/
});
};
</script>
If there is no return on the execution of your url
, the , function(retorno){}
does not need to be issued.