Reputation: 1462
I've a function like this;
<script type="text/javascript">
function callUrl(url) {
$.post(url);
alert('You'll redirect a telephone');
}
</script>
I'm only want to work url. When the url'll worked, the user call a telephone. I'm correctly getting url. But $.post(url); doesn't work. How do you solve this?
Upvotes: 1
Views: 258
Reputation: 1924
You need to write "success"
$.ajax({
url: "test.html",
success: function(){
alert("");
}
});
Upvotes: 0
Reputation: 8333
you need to encode url use encodeURIComponent function
<script type="text/javascript">
function callUrl(url) {
$.post(encodeURIComponent(url));
alert('You\'ll redirect a telephone');
}
</script>
Upvotes: 0
Reputation: 3240
Pass a success handler to the $.post method to perform your callbacks.
$.post(url, function(data) {
// Call the phone here
});
Upvotes: 1