Why isn’t it working?
On the stretch where you are using the load(url)
, I imagine you expect him to access url
which provided and when the execution gets there you finish solving things. However, load(...)
in its code makes the javascript
understand that there is a function called load
, just as function load(url){...}
created or imported by you at some point. In jQuery
the correct would be to use the function $.load()
[+] assigned to some element in its HTML
, for example: $("body").load(url)
. Note that the statement here is different from the way you tried on your first attempt.
That is the solution
The jQuery
provides the function $.get
[+] and $.post
[+], that are nothing more than shortcuts to the $.ajax(...)
[+] that allows you to perform access to a url
by his code javascript
. This function is exclusive to jQuery
, which can be downloaded by here.
If you test it, you’ll see $.load
works like the $.get
. The documentation of jQuery
explains how to use the two forms. $.load
is assigned to some element in the structure that will receive the response of the url
, $.get
will depend on with you will want to deal with the response of the execution 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 from the execution of your url
, the stretch , function(retorno){}
does not need to be issued.
Barter
load(...)
for$.get(...)
.– William Novak
Thanks friend had forgotten the get remembered that the load was for me to take something from the page and print on another Valew same thank you etc
– gezer
It was a pleasure to help, Gezer! @Anthonyaccioly, posted a more elaborate reply. Thank you ;)
– William Novak