Answer the question
In order to leave comments, you need to log in
How to pass variable values?
Hello, I have a code
$.ajax({
url : '****',
type : "GET",
dataType : "jsonp",
success : function(msg){
var videoparam = [msg.response['url240'],msg.response['url360'],msg.response['url480'],msg.response['url720']];
}
});
Answer the question
In order to leave comments, you need to log in
ajax is executed asynchronously, so you need to use callbacks
$.ajax({
url : '****',
type : "GET",
dataType : "jsonp",
success : function(msg){
var videoparam = [msg.response['url240'],msg.response['url360'],msg.response['url480'],msg.response['url720']];
callOtherFunction(videoparam);
}
});
function callOtherFunction(videoparam) {
/* здесь работаем с массивом */
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question