Skip to content

Instantly share code, notes, and snippets.

@ds729
ds729 / gist:2405052
Created April 17, 2012 10:04
画像の先読み
//画像の先読み
function loadImg(imgArr){
for(var i=0;i<imgArr.length;i++){
var imgObj=new Image();
imgObj.src=imgArr[i];
console.log(i);
}}
var arr=["paint01.png","paint02.png","paint03.png","paint04.png","paint05.png"];
loadImg(arr);
@ds729
ds729 / gist:2405039
Created April 17, 2012 10:00
文字列から任意の文字の数をカウントする
//文字列から任意の文字の数をカウントする
function dataCount(keyStr,word ){
var cnt=word.split(keyStr).length-1;
return count;
}
@ds729
ds729 / gist:2404954
Created April 17, 2012 09:48
ツイートの件数を取得する
//ツイートの件数を取得する
$.getJSON("https://api.twitter.com/1/users/lookup.json?callback=?&screen_name=ds_style729&include_entities=true",
function(data) {
//console.log(data[0].statuses_count);
if(data!== undefined) {
$(".tweet").html("The present tweet number is " + data[0].statuses_count +".");
}
});
}