That depends entirely on what simpleWeather
does with the object you put in there. by the looks of it, simpleWeather is a jquery extension. you can view those as a function that takes parameters, and may (or may not) return a jquery selector.
if simpleWeather returns a jquery itself rather than a bare jquery selector (or indeed nothing at all), you can do this :
var sw = $.simpleWeather({
location: coordinates,
unit: 'c'
}
console.log(sw.unit);
You might want to try doing this, just to figure out what is actually in the return value of the jquery extension.
var sw = $.simpleWeather({
location: coordinates,
unit: 'c'
}
console.log(sw);
if there is no way to retrieve the unit from the return value of the extension, you might want to keep separate track of it.
In case of multiple instances you could do this with an array, something like this :
var swInstances = [];
...
var swParameters = {
unit : 'c',
location : coordinates,
};
swInstances.push({
usedParameters : swParameters,
simpleWeatherInstance : $.simpleWeather(swParameters)
});
you can then use the swInstances array to access all the information you’d need per simpleWeather instance.
solved How to get a value from $.something{(…)}