为什么在点击事件后没有显示此代码的属性?
属性this.ContainerId
在输入this.ShoutCount
方法时变为未定义。
谢谢。
var table = function (containerId) {
this.ContainerId = containerId;
this.ShoutCount = function (totalC) {
var label = $("#" + this.ContainerId + " .result").text();
alert(totalC + " " + label);
}
this.ClickCount = function (sc) {
$("#" + this.ContainerId + " .showTotalCount").click(function () {
sc($(this).text());
});
}
this.ClickCount(this.ShoutCount);
}
var t = new table("user-tab-pagination");

<div id="user-tab-pagination">
<div class="search-count"><span class="showTotalCount">100</span> <span class="result">Result(s)</span></div>
</div>
&#13;