Popular Posts
javax.net.ssl.SSLHandshakeException: Connection closed by peer in Android 5.0 Lollipop Recently, there is a error occurs when access website via ssl connection like below although it worked fine several days ago. // Enable SSL... SwiXml SwiX ml , is a small GUI generating engine for Java applications and applets. Graphical User Interfaces are described in XML documents that ... executeOrDelayUntilScriptLoaded Executes the specified function if the file containing it is loaded; otherwise, adds it to the pending job queue. ExecuteOrDelayUntilScrip...
Stats
jQuery delegate
<html>
<head>
<script type="text/javascript" src="jquery-1.7.1.min.js"></script>
<script type="text/javascript">
    $(function(){
        // add row button
        $('.append_button').click(function(){
            var row = $('<div class="lister">'+new Date()+'&nbsp;&nbsp;&nbsp;<input type="button" class="row_button" value="click me!" /></div>');
            row.appendTo('.container');
        });
        
        // delegate for append button
        $('.container').delegate('.lister input:button', 'click', function(){
            alert('delegate ok!');
        });
        // delegate for append button (falied, because .lister was not found on delegate action)
        $('.container .lister').delegate('input:button', 'click', function(){
            alert('delegate, again!');
        });
    });
</script>
</head>
<body>
<div class="container">
    <input type="button" class="append_button" value="Add" />
</div>
</body>
</html>