在HTML中如果有巢狀的元件或是重疊的元件,例如下列的範例li與p,假如都加入click Event時,會發生各自執行這兩個click。
<ul id="parent">
<li>
click me
<p class="contained">click to hide</p>
</li>
</ul>
在HTML中如果有巢狀的元件或是重疊的元件,例如下列的範例li與p,假如都加入click Event時,會發生各自執行這兩個click。
<ul id="parent">
<li>
click me
<p class="contained">click to hide</p>
</li>
</ul>
$.widget( "nmk.progressbar", {
options: {
value: 0
},
_create: function() {
this.element.addClass( "progressbar" );
this._update();
},
_setOption: function( key, value ) {
this.options[ key ] = value;
this._update();
},
_update: function() {
var progress = this.options.value + "%";
this.element.text( progress );
if ( this.options.value == 100 ) {
this._trigger( "complete", null, { value: 100 } );
}
}
});
Restful的結構用途非常廣、如程式或Web service之間的傳輸協定,都是採用此結構。目前業界最常用的就是Json。因此我們就介紹一下在Web設計中,如何傳回Json格式
【Web設計】