判断是否ip地址
1 | function check_is_ip(s) { |
字符串格式化
1 | String.prototype.format = function() { |
随机数
1 | function getRandomInt(min, max) { |
打开新的tab
1 | window.open('www.yourdomain.com','_blank'); |
重定向
1 | window.location = "http://www.yourdomain.com"; |
清除字符串两边空格
1 | s = $.trim(s) |
string转int
1 | // parseInt(string, radix) |
ajax请求
1 | $.ajax({ |
select
1 | # 增加项 |
交换两行
1 | $("body").on("click", ".btn-index-down", function(){ |
动态生成的元素捕获事件
1 | $("body").on("click", ".result-table-th", function() { |
js 转移html字符
1 | var entityMap = { |
字体
1 | "Helvetica Neue",Roboto,Arial,"Droid Sans",sans-serif |