Giter VIP home page Giter VIP logo

javascriptlib's Introduction

libc.js方法列表

  • 按指定字符截断
console.log("33:".rtrim(':'));       打印结果 33  
console.log("123$456".rtrim('456')); 打印结果 123$  
  • 时间对象转string
console.log((new Date()).Format("yyyy-MM-dd hh:mm"));  
console.log((new Date()).Format("yyyyMMddhhmm"));   
打印结果 2022-05-07  
打印结果 202205071722  

libb.js方法列表

  • 写入浏览器的cookie
MyCookie.setCookie("mydata","2022-3-19 11:16","10s");
console.log(MyCookie.getCookie("mydata"));  
  • 对象是否为空
var a;  
console.log(isEmpty(a));  
  • 股票处理类,转带前缀的sh00154,sz600545
console.log(MyStock.toShSz('600123'));   
  • 自动生成table表格
var myList = [  
   { "name": "abc",  "age": 50 ,  "hobby": "打麻将"},  
   { "name": "李四", "age": "25", "hobby": "swimming" },  
   { "name": "王五", "age": "13", "hobby": "dak" },  
   { "name": "赵六", "age": "44", "hobby": "smoke" },  
   { "name": "张七", "age": "21", "hobby": "sleep" },  
   { "name": "xyz",  "age": "18", "hobby": "programming" }  ];  
// var par = { "列名":"auto" , "数据组": myList , "表ID" : "tableMSA" , "隐藏列":"", "列顺序":"","合并显示":"false","  合并主键":"code" };  
myTable.par["列名"] = "a,b,c";  
var html =  myTable.get_html_table(myList);  
$('#app').html(html);  
  • 写入和读取local Storege
console.log(MyCookie.save_input("#key","testData"));  
console.log(MyCookie.ReadStorage("#key","testData"))     
  • 显示页面局部信息iframe
myIframe.div["width"] = "220px";
myIframe.div["height"] = "320px";
myIframe.div["scrolling"] = "no";
myIframe.frame["margin-left"] = "-20px";
myIframe.frame["margin-top"] = "-200px";
myIframe.SetDiv("#dv3");

参考网文

prototype属性为javascript对象扩展属性和方法

javascriptlib's People

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.