タグ

2011年8月30日のブックマーク (2件)

  • twihelp.me

    twihelp.me 2019 Copyright. All Rights Reserved. The Sponsored Listings displayed above are served automatically by a third party. Neither the service provider nor the domain owner maintain any relationship with the advertisers. In case of trademark issues please contact the domain owner directly (contact information can be found in whois). Privacy Policy

    hideki_a
    hideki_a 2011/08/30
    MJLを入れていない場合に、どうしてもIEを細かいバージョンで区別したい場合があるので。
  • $.dataはHTML5 datasetのラッパーではない

    $.dataはHTML5のdatasetラッパーでない HTML5では要素に任意の属性を追加出来るdata-*属性がサポートされました。仕様では <div data-foo="bar">...</div> data-fooの値はdiv.dataset.fooでアクセスすることが出来ます。ただしdatasetは現在一部ブラウザでしかサポートされていない。。そこでjQueryに存在する$.dataメソッドを使いましょう、という流れなのですが、$.dataをラッパーとして見た場合結構罠がありおすすめ出来ません。中途半端に対応してしまったために誤解されがちですが、$.dataはdatasetのラッパーではありません。 属性値がJSONとして解釈出来る場合、パースして返す <div id="test1" data-json="{"foo":"bar"}">...</div> $('#foo').da