I have the jquery var location_dir
is set and used in var like so:
var location_dir = 'home/user';
var settings = {
formData: {
location: location_dir
}
}
$("#mulitplefileuploader").uploadFile(settings);
location_dir
get's updated with click events like so:
$(document).on('click', 'a.folder', function () {
location_dir = $(this).data("location");
});
So my final script look like this:
var location_dir = 'home/user';
$(document).on('click', 'a.folder', function () {
location_dir = $(this).data("location");
});
var settings = {
formData: {
location: location_dir
}
}
$("#mulitplefileuploader").uploadFile(settings);
The issue is that location_dir
is not getting updated on those click events and instead maintaing the initial value. Do I need to wrap the var settings = { ...
in a function or something?