G
G
green_o2015-10-12 12:43:56
JavaScript
green_o, 2015-10-12 12:43:56

Chrome storage,storage.set message not recognized?

Plz tell me what is the problem?

document.getElementById('change').addEventListener('click', function() {
 
 over_lol =(document.getElementById('lo').value)
 lol = document.getElementById('lol').value
 check_lol = document.getElementById('lol_check').value
 
 if (lol != '' && check_lol != '')
 { 
if ( lol == check_lol) {
 var p = hex_md5(lol);
 
 chrome.storage.local.set({over_lol: p },
     function () {

     // message('Settings saved');

     })
}
 //else{ alert('Данные не совпадают')}

 else{ alert('Введите данные')}
 
}

 });

I see this error:
Error in response to storage.set: ReferenceError: message is not defined
at Object.callback (chrome-extension://kdlbhffehlpefpcfepfeancilanfcmgn/avt.js:22:7)
at HTMLInputElement. (chrome-extension://kdlbhffehlpefpcfepfeancilanfcmgn/avt.js:19:23)

Tell me how to treat plz

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
Dmitry Kovalsky, 2015-10-12
@dmitryKovalskiy

Well, first of all - to explain what message is and where an object with such a name is described. There is a risk that at the moment your handler is triggered, it really does not exist or it is not visible in scopes.

K
keslo, 2015-10-12
@keslo

What is the purpose of declared global variables? Maybe you should first declare them through var?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question