小编Rog*_*r W的帖子

多个构造函数不起作用

好的,所以我试图学习如何使用多个构造函数,并且不能完全理解为什么调用这些不同的方法不起作用 - 实际上第一个方法不会编译.

谢谢你的关注...

    // Compile error here. I'm trying to call the 2nd Counter method with default values.
    public void Counter() {
    this.Counter(0, false); 
}

// Here I'm trying to enable a call to the Counter method with integer and boolean attributes in its call.

    public Counter(int startingValue, boolean check) {
    this.startingValue = startingValue;
    this.check = check;
}
Run Code Online (Sandbox Code Playgroud)

java constructor

0
推荐指数
1
解决办法
69
查看次数

将内容加载到div中,然后访问加载的内容JavaScript

我正在动态地将内容加载到div(可以正常工作)但是无法使用加载的内容的JavaScript.

这是我从可点击的无序列表项调用的加载代码:

<div id="resources" class="tabcontent">
<script>
  $("#resources").load("pages/resources.html");
</script>
</div>
Run Code Online (Sandbox Code Playgroud)

一旦加载了pages/resources.html,就会在其中加入一堆类似的JavaScript,将更多的HTML页面加载到该页面内的div中.

html javascript jquery dom

0
推荐指数
1
解决办法
115
查看次数

标签 统计

constructor ×1

dom ×1

html ×1

java ×1

javascript ×1

jquery ×1