jquery function return
function myFunction(p1, p2) {
var a = "";
$.post( "/url", function( data ) {a = data.result;});
return a;
}
jquery function return
function myFunction(p1, p2) {
var a = "";
$.post( "/url", function( data ) {a = data.result;});
return a;
}
jquery function return
function myFunction(p1, p2) {
var a = "";
$.ajax({
method: "POST",
url: "/url",
data: {p1: p1,p2: p2},
success: function (data) {a = data.result;},
error: function (data) {a = data.result;}
});
return a;
}
what does return do in javascript
function add(a, b) {
return a + b; //Return stops the execution of this function
}
var sum = add(5, 24); //The value that was returned got but inside the variable sum
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us