Zusaarのページを更新しました

1
2
3
4
5
6
7
var text = 'hoge';
var $el =
  $('<ul/>').append(
    $('<li/>').append(
      $('<p/>').html(text)
    )
  );
1
2
3
4
5
<ul>
  <li>
    <p>hoge</p>
  </li>
</ul>
1
2
3
var $ul = $('<ul/>');
var $li = Mustache.render('<li><p>{{text}}</p></li>', {text: 'hoge'});
$ul.append($li);
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
{
    list: [{
        text: 'hoge1'
    }, {
        text: 'hoge2'
    }, {
        text: 'hoge3'
    }, {
        text: 'hoge4'
    }]
}
1
2
3
4
5
6
{{#list}}
<ul>
    <li><p>{{text}}</p></li>
</ul>
{{/list}}
{{^list}}<p>値はありません</p>{{/list}}
1
2
3
events.forEach(function(value){
    $html.append(Mustache.render(template, value));
});
1
2
3
4
Oboe(url)
.node('events.*', function(value){
    $html.append(Mustache.render(template, value));
});
comments powered by Disqus
Built with Hugo
Theme Stack designed by Jimmy