https://app.codegrid.net/entry/breakpoint-1
// この一文でprototypeプロパティが使えるようになる
function Foo() {};
// ここで定義を代入。
Foo.prototype = {
init:function() { alert('A');},
test:function() { alert('B');}
};
// newして使う必要があるのか・・・ var foo = new Foo(); foo.init();
function Foo() {};
Foo.prototype = {
init:function() { alert('A');},
test:function() { alert('B');}
};
Foo.A = function()
{
alert('A is static');
}
Foo.B = function()
{
alert('B is static');
}
// newして使う必要があるのか・・・
var foo = new Foo();
foo.init();
// prototypeをはさまないとそのまま実行可能!
Foo.A();
Foo.B();
一昔前の主流
2009年現在はこちらのほうがよろしいらしい。
http://www.slideshare.net/hayatomizuno/jquery-7665168
http://web-terminal.blogspot.jp/2012/11/jquery4.html
$(function () { alert('test'); });
setInterval(function(){ alert('test'); },10000);
if ($('#探したい場所のID .その配下のクラス').length > 0) { alert('test'); }
alert(typeof($.cookies.set));
定義されていればobjectとでる。
$('li')
$('li.hoge')
$('li#hoge')
$('DIV#contents LI')
$('DIV#contents > LI')
$('#first, #third")
$("a[href]").each(function(){
}
$("DIV#hoge a[href]").each(function(){
}
$("input[type='checkbox']").removeAttr( 'checked' );
$("input[type='checkbox']").attr( 'checked', 'checked' );
$(".hoge .fuga input[type='checkbox']").removeAttr( 'checked' );$("[href]")
$("[href='hoge']")
$("[href^='hoge']")
$("[href$='hoge']")
$("input").val();
$("input").val("初期値");$("input").("focus",function(){});
$("input").("blur",function(){});
$("input").("change",function(){});
input[type='text'] input[type='password'] input[type='radio'] input[type='checkbox'] input[type='submit'] input[type='image']
:selected :checked
JavaでかかれたJavaScript実装。J2SE6.0から標準添付