Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- chrome.storage.sync.get($div.attr('id'),function(items){
- var lastError = chrome.runtime.lastError;
- if (lastError) console.log($div.attr('id')+" does not exist.n", lastError);
- else chrome.storage.sync.set({$div.attr('id'):$div.html()}, function(){}); //I'm having the error from this line
- });
- var myobj = {}, key = $div.attr('id');
- myobj[key] = $div.html();
- chrome.storage.sync.get(key,function(items){
- var lastError = chrome.runtime.lastError;
- if (lastError) console.log(key+" does not exist.n", lastError);
- else chrome.storage.sync.set(myobj, function(){}); //The error is gone
- });
- {$div.attr('id'):$div.html()}
- else {
- var obj = {}, key = $div.attr('id');
- obj[key] = $div.html();
- chrome.storage.sync.set(obj, function(){});
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement