i want to use value variable data from outside.How can i doing this? please help
Asked
Active
Viewed 15 times
1 Answers
0
if i had anderstood, you can pass the variable as argument of the function but to pass an argoment to a function in a function you can do function(firstparameterOfTheFirstFunction)(secondoparameterOFtheSeconFunction)

Gianmarco
- 792
- 2
- 14
- 38
-
var value = ''; $.ajax({ url: 'new2.php', //This is the current doc type: "POST", dataType:'json', // async: false,// add json datatype to get json data: ({id: 2}), success: function(data) { //console.log(data); value = data[1]; i want to use the data of this variable called "value" form outside of ajax scope without pass any parameter or function.is it possible? – Sourav Biswas Jun 16 '18 at 08:03
-
try reading this: https://stackoverflow.com/questions/16942043/access-variable-outside-function-scope – Gianmarco Jun 16 '18 at 08:18