"사용자:다메즈마/common.js"의 두 판 사이의 차이

3번째 줄: 3번째 줄:
 
});
 
});
 
alert("hello");
 
alert("hello");
 +
$("a[href$=.ogg]").each((index, it)=>{
 +
mw.Api({
 +
action="query",
 +
title=$(it).html(),
 +
prop="imageinfo",
 +
iiprop="url",
 +
format="json"
 +
}).done((res)=>{
 +
for(var it of res.query.pages){
 +
    console.log(it.imageinfo[0].url);
 +
}
 +
 +
});
 +
});

2018년 11월 12일 (월) 08:21 판

$(document).on("click", "a", function(e){
 e.preventDefault();
});
alert("hello");
$("a[href$=.ogg]").each((index, it)=>{
mw.Api({
action="query",
title=$(it).html(),
prop="imageinfo",
iiprop="url",
format="json"
}).done((res)=>{
for(var it of res.query.pages){
    console.log(it.imageinfo[0].url);
}

});
});