I have a button id="button" It has an onclick event that changes window location, as well as a .click bind in JQUERY For the .click bind Im trying to do a .post call and if any data is returned cancel
JQUERY not working as expected
9
I have a button id="button"
It has an onclick event that changes window location, as well as a .click bind in JQUERY
For the .click bind Im trying to do a .post call and if any data is returned cancel
the original onclick event.
I thought this following code would do it but its not working as expected:
Any insight would be most appreciated.
It has an onclick event that changes window location, as well as a .click bind in JQUERY
For the .click bind Im trying to do a .post call and if any data is returned cancel
the original onclick event.
I thought this following code would do it but its not working as expected:
Code:
$("#button").click(function (event) {
$.post('URL', function(data) {
alert(data);
if (data!=""){$('#button').unbind('click');}
$('body').append(data);
});
}); - Tradeout
- WealthWithin
- [1] reply
- FirstSocialApps
- SteveJohnson
- FirstSocialApps
- SteveJohnson
- [ 1 ] Thanks
- [1] reply
- FirstSocialApps
Next Topics on Trending Feed
-
9