Could anyone help me troubleshoot my code issue? I successfully save the data, but when trying to load it, the saved data cannot be found:
Here is the code snippet:
$('#SaveSet').click(function() {
var theValue = $('#col').val();
if (!theValue) {
alert('Error: No value specified');
return;
}
chrome.storage.sync.set({
'ToSave': theValue
}, function() {
alert('Settings saved' + " " + theValue);
});
});
$('#Get').click(function() {
alert('working');
chrome.storage.sync.get("ToSave", function(data) {
alert("data" + data);
});
});
After attempting to get the data, the alert shows "data[object Object]"