for (var i in obj) цикл предназначеный для перечисления ключей объекта, иногда можно использовать для массивов, но очень осторожно.for(var i = 0; i<a.length; i++) цикл для массивов, здесь индексы будут по порядкуfunction func(i){
return function(){
console.log('Переменная i = ' + i + ', тип ' + typeof i);
}
}
for(var i in [9]) {setTimeout(func(i),0);}
for(var i in {1:2}) {setTimeout(func(i),0);}
checkID: function(id, callback) {
this.db.transaction(function (tx) {
tx.executeSql("SELECT * FROM black WHERE id = ?", [id], function(tx,result){
var answer;
if (result.rows.length > 0) {
//document.querySelector('#status').innerHTML += '<p>' + result.rows.item(0).link; + '</p>';
answer = {"id": result.rows.item(0).id, "link":result.rows.item(0).link};
} else {
//document.querySelector('#status').innerHTML += '<p>Не найдено</p>';
answer = {"clean": true};
}
callback(null, answer);
},
function (tx, err) {
callback(err, answer);
}
);
});
},obj.checkID(id, function(error, answer){
if (!error)
console.log(answer);
});
#mydiv {
-webkit-animation: myAnimate 5s; /* Chrome, Safari, Opera */
animation: myAnimate 5s;
}
/* Chrome, Safari, Opera */
@-webkit-keyframes myAnimate {
from {
background: -webkit-linear-gradient(180deg, red, blue); /* For Safari 5.1 to 6.0 */
background: -o-linear-gradient(180deg, red, blue); /* For Opera 11.1 to 12.0 */
background: -moz-linear-gradient(180deg, red, blue); /* For Firefox 3.6 to 15 */
background: linear-gradient(180deg, red, blue); /* Standard syntax */
}
to {
background: -webkit-linear-gradient(0deg, blue, red); /* For Safari 5.1 to 6.0 */
background: -o-linear-gradient(0deg, blue, red); /* For Opera 11.1 to 12.0 */
background: -moz-linear-gradient(0deg, blue, red); /* For Firefox 3.6 to 15 */
background: linear-gradient(0deg, blue, red); /* Standard syntax */
}
}
/* Standard syntax */
@keyframes myAnimate {
from {
background: -webkit-linear-gradient(180deg, red, blue); /* For Safari 5.1 to 6.0 */
background: -o-linear-gradient(180deg, red, blue); /* For Opera 11.1 to 12.0 */
background: -moz-linear-gradient(180deg, red, blue); /* For Firefox 3.6 to 15 */
background: linear-gradient(180deg, red, blue); /* Standard syntax */
}
to {
background: -webkit-linear-gradient(0deg, blue, red); /* For Safari 5.1 to 6.0 */
background: -o-linear-gradient(0deg, blue, red); /* For Opera 11.1 to 12.0 */
background: -moz-linear-gradient(0deg, blue, red); /* For Firefox 3.6 to 15 */
background: linear-gradient(0deg, blue, red); /* Standard syntax */
}
}
{
"manifest_version": 2,
"name": "Demo for content script with require.js",
"version": "0.0",
"description": "This is demonstration for how to use require.js in content scripts",
"content_scripts": [
{
"matches": ["http://*/*", "https://*/*"],
"js": ["lib/require.js", "lib/require-cs.js", "app/main.js"]
}
],
"web_accessible_resources":["app/App.js"]
}