小编sha*_*ank的帖子

追加后jquery事件无法正常工作

http://jsfiddle.net/YsnhT/2/

追加后Jquery事件开启不起作用.单击"保存"按钮后,我需要textarea的值.

$('.span8')
    .on('click',
            '.btn',
            function() {
        var input = $("#textarea").val();
        alert(input);
    });

$('body').on('click','#createNote',function() {                $('.span8').empty();
                $('.span8').append('<button type="button" class="btn" style="float: right; margin-right: 8px;background-color:#dddddd;font-family:Roboto Slab;color: black" id="save" data-loading-text="Saving...">Save</button><div class="hero-unit"><input type="text" style="width: 100%" id="title" placeholder="Title"/>'+ 
                '<textarea contenteditable="true" id="textarea" class="textarea" placeholder="Enter text ..."style="width: 100%;">dd</textarea></div>');

            });
Run Code Online (Sandbox Code Playgroud)

HTML:

<div class="span8"></div>
Run Code Online (Sandbox Code Playgroud)

javascript jquery

5
推荐指数
1
解决办法
1万
查看次数

如何检查数据库中是否存在多个值?

我在a@a.com代码中有一个电子邮件地址列表,我想检查b@b.com数据库中是否存在任何这些地址.例如:

  1. c@c.com
  2. a@a.com
  3. b@b.com

我想知道上面的任何电子邮件ID是否已经存在于表中,如果有,我想将它们拉出或分开.
我不知道如何实现这个目标?
我应该在Java中尝试这个,还是有一个查询MySQL可以帮助我?

mysql java-ee

2
推荐指数
1
解决办法
1万
查看次数

在"链接"列表中的特定位置插入节点

我被赋予指向链表的头节点的指针,要添加到列表的整数以及必须插入整数的位置.将此节点插入所需位置后,我需要返回头节点.

我写的代码由于某种原因不起作用,并且进入无限循环.

  class Node {
     int data;
     Node next;
  }


Node InsertNth(Node head, int data, int position) {
    int count = 0;
    Node node = head;
    Node prev = null;
    while(count != position){
      count++;
      node = node.next;
      prev = node;
    }

    Node newNode = new Node();
    newNode.data = data;


    newNode.next = node;
    if(count == 0){
          head = newNode;
       }else{
          prev.next = newNode;
    }

    return head;          
}
Run Code Online (Sandbox Code Playgroud)

java algorithm linked-list data-structures

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