2016年4月29日 星期五

4/29

<form action="#" method="post" class="demoForm" id="demoForm">
    <fieldset>
        <legend>Demo: Get Value of Selected</legend>
    
    <p>Select a shipping method:</p>
    <p>
        <label><input type="radio" name="ship" value="A" checked /> A</label>
        <label><input type="radio" name="ship" value="B" />B</label>
        <label><input type="radio" name="ship" value="C" /> C</label>
        <label><input type="radio" name="ship" value="D" /> D</label>
    </p>
    
    <p><button type="button" name="getVal">Get Value of Selected</button></p>
    
    </fieldset>
</form>
<script type="text/javascript">
// to remove from global namespace
(function() {
    
    function getRadioVal(form, name) {
        var val;
        var radios = form.elements[name];
        
        for (var i=0, len=radios.length; i<len; i++) {
            if ( radios[i].checked ) {
                val = radios[i].value;
                break;
            }
        }
        return val;
    }
    document.forms['demoForm'].elements['getVal'].onclick = function() {
        alert( 'The selected radio button\'s value is: ' + getRadioVal(this.form, 'ship') );
    };
    
    
    // disable submission of all forms on this page
    for (var i=0, len=document.forms.length; i<len; i++) {
        document.forms[i].onsubmit = function() { return false; };
    }
    
}());
</script>

2016年4月15日 星期五

4/15

package haha;
import java.sql.Connection;
import java.sql.DriverManager;
public class haha {
    public static void main(String[] args) {
        // TODO Auto-generated method stub
        System.out.println("Hello! World!");
         Connection c = null;
          try {
           Class.forName("org.sqlite.JDBC");
           c = DriverManager.getConnection("jdbc:sqlite:test.db");
          } catch (Exception e) {
           System.err.println(e.getClass().getName() + ": " + e.getMessage());
           System.exit(0);
          }
          System.out.println("Opened database successfully");
    }
}

2016年4月1日 星期五

4/1

public class HelloWorld {
    public static void main(String[] args) {
        System.out.println("Hello! World!");
    }
}
___________________________________________________
package text1;
import java.sql.Connection;
import java.sql.DriverManager;
public class text1 {
   
    public static void main(String[] args) {
        // TODO Auto-generated method stub
        Connection c = null;
          try {
           Class.forName("org.sqlite.JDBC");
           c = DriverManager.getConnection("jdbc:sqlite:test.db");
          } catch (Exception e) {
           System.err.println(e.getClass().getName() + ": " + e.getMessage());
           System.exit(0);
          }
          System.out.println("Opened database successfully");
       
    }
}