Tag:Reprinted from

  • Function usage in JavaScript

    Time:2020-6-19

    4) Function usage Example 3.4.1         /*When the Global object is created, it always has at least the following properties:       Object object       Function object       Array object       String object       Boolean object       Number object       Date object       Math object       Value properties   */     /*The advantage of function is that the function body can be an incoming dynamic […]

  • The use of constructors in JavaScript

    Time:2020-4-30

    5) Constructor usage: Example 3.5.1     Function student (name, age) { / * mark to win: later on we can use it in var doc = new activexobject (“Microsoft. XMLDOM”); doc. Async = “false”; doc. Load (STR); when a property has a this, Means that this property is a member property. * / this. Name […]

  • Onload usage in JavaScript

    Time:2020-4-23

    7)onload Onload is to wait until the page is loaded. Example 3.7.1                 <!–        function a(b)        {document.write(“part 1”);        }         //–>    Part2, onload will be executed after Part1 and part2 are printed. Article reprinted from: https://blog.csdn.net/qq_/article/details/100091795

  • The usage of prototype in JavaScript

    Time:2020-4-14

    prototypeSee the previous section, mark to win: prototype is to add an instance method to a class. Example 3.6.2       /*When the Global object is created, it always has at least the following properties:       Object object       Function object       Array object       String object       Boolean object       Number object       Date object       Math object       Value properties   */    Array.prototype.mymethod […]

  • Arguments usage in JavaScript

    Time:2020-4-3

    8)arguments Example 3.8.1     / * mark to win: when there are n functions with the same function name, only the last one is used. * / function test() { document. Writeln (“no argument constructor.”); } function test (person) { document. Writeln (“mark to win2”); /*Function. Arguments [] (Collection) the values passed to the function […]

  • Eclipse 3.62 develops the first Java program HelloWorld

    Time:2020-2-29

    [study notes] Develop the first Java program with eclipse 3.62: You need to configure the JDK before using eclipse. Window / preference / Java / installed jres, please refer to the video for details. In our book (spring architecture, AJAX, Android), eclipse 3.62 is used, so we also need to explain how to run HelloWorld […]

  • An example of JNDI used to find datasource in JDBC in Java

    Time:2019-12-30

    [study notes] 8. Example of JNDI used to find datasource: import javax.naming.InitialContext;import javax.naming.Context; import com.mysql.jdbc.jdbc2.optional.MysqlConnectionPoolDataSource; import java.util.Properties;import net.sourceforge.jtds.jdbcx.*;public class ClassPut {        public static void main(String a[]) {                try {/*                  JtdsDataSource dataSource=new  JtdsDataSource();                        dataSource.setServerName(“localhost”);                        dataSource.setDatabaseName(“NorthWind”);                        dataSource.setUser(“sa”);                        dataSource.setPassword(“1234”);*/                    MysqlConnectionPoolDataSource ds = new MysqlConnectionPoolDataSource();                    ds.setURL(“jdbc:mysql://localhost:3306/test”);                    ds.setUser(“root”);                    ds.setPassword(“1234”);                                                                                              Properties prop = new Properties();                        prop.setProperty(Context.INITIAL_CONTEXT_FACTORY,                                        “com.sun.jndi.fscontext.RefFSContextFactory”);                         Context […]

  • Give an example of HelloWorld in JavaScript

    Time:2019-12-26

    1. Basic knowledge:1)Helloworld: Example 1.1 In this paper, the author analyzes the characteristics of ent.writeln(a);We Article reprinted from the original: https://blog.csdn.net/qq_/article/details/97655818

  • Transaction example in JDBC in Java

    Time:2019-10-4

    [Learning Notes] 7. JDBC transaction example: import java.sql.*; public class MySQlTransaction1 {   public static void main(String[] args) throws SQLException {/*in my sql: create table Accounts(                ID int(4) not null,                NAME varchar(15),                BALANCE int(4),                primary key(ID)            )  type=INNODB;  insert into Accounts values(1,’wangwu’,100);  insert into Accounts values(3,’zhangsan’,300);  insert into Accounts values(4,’lisi’,400);     */    Connection con = null;    […]