学点js

来源:互联网 发布:17年网络群体事件 编辑:程序博客网 时间:2024/06/05 15:08
  • js的方法是覆盖的,后面声明的会覆盖前面的。无论在js文件还是html文件
  • 对象的声明方法:
    • function comet_message() {
    • this.id = "";
    • this.parentid = "";
    • this.action = "";
    • this.tr = "";
    • }
  • 方法的声明:
    • function applyMessageContent(data, table_id) {
    • var arr = data.split("@_@");
    • var order = new comet_message();
    • order.id = arr[0].replace("/r/n", "");
    • order.parentid = arr[1];
    • order.action = arr[2];
    • order.tr = arr[3];
    • process(order, data, table_id);
    • return order;
    • }
原创粉丝点击