摘要: 1.获取页面上的所有iframe标签遍历获取每一个iframe 获取所有的iframe let iframes = document.getElementsByTagName("iframe");//遍历iframesfor (let i = 0; i < iframes.length; i++) 阅读全文
posted @ 2021-12-23 14:24 鞋带松了 阅读(1117) 评论(0) 推荐(0) 编辑
摘要: 笔记:学习记录 问题:cookies存储的大小超过4kb时,会有数据丢失。 解决方法: 1.localStorage 代替cookies 2.sessionStorage 代替cookies JS localStorage对象使用/sessionStorage使用 1. length属性 返回存储对 阅读全文
posted @ 2021-12-23 13:38 鞋带松了 阅读(309) 评论(0) 推荐(0) 编辑
摘要: ruby1.9开始对字符串编码支持已经比较完善,我们可以直接通过使用String类的实例方法encoding, force_encoding, encode, encode!进行相关的编码操作。 学习记录用。转载自网络,详细看参考链接 encoding ruby1.9中为每个字符串对象增加了enco 阅读全文
posted @ 2021-12-23 09:44 鞋带松了 阅读(335) 评论(0) 推荐(0) 编辑
摘要: wiki: ruby代码: def self.unzip_file zip_file_path if Rails.env == "development" self.window_unzip_file zip_file_path else self.linux_unzip_file zip_file 阅读全文
posted @ 2021-12-23 09:37 鞋带松了 阅读(215) 评论(0) 推荐(0) 编辑
摘要: 一、文件操作 f=File.new("#{File.dirname(__FILE__)}/temp.m", "w+") f.puts("I am lmy") 1、文件模式 "r" :只读。从文件开头开始(默认模式)。 "r+" :读写。从文件的开头开始。 "w" :只写。将现有文件截断为零长度,或创 阅读全文
posted @ 2021-12-23 08:44 鞋带松了 阅读(192) 评论(0) 推荐(0) 编辑
摘要: 问题: Paperclip xlsx 能通过content type 验证,但xls 不行。 代码如下: validates_attachment_content_type :file, :content_type => [ "application/pdf", "image/jpeg", "ima 阅读全文
posted @ 2021-12-22 17:16 鞋带松了 阅读(59) 评论(0) 推荐(0) 编辑
摘要: 要判断数组中是否包含某个元素 var arr = [ "xml", "html", "css", "js" ]; $.inArray("js", arr); //返回 3, //全选 $("input[name='checkbox']").attr("checked","true"); //取消全选 阅读全文
posted @ 2021-08-26 16:36 鞋带松了 阅读(31) 评论(0) 推荐(0) 编辑
摘要: 一、新一个rais项目:rails new active_job --skip-bundle 进入项目文件夹: cd active_job 打开Gemfile文件:vim Gemfile 把source 'https://rubygems.org'改为source 'https://ruby.tao 阅读全文
posted @ 2021-08-26 16:21 鞋带松了 阅读(120) 评论(0) 推荐(0) 编辑
摘要: Rails5正式版, 终于经过众多测试版后,与我们见面了,本文就来介绍一下,在Rails5中有哪些关于ActiveRecord相关的新特性,以便能够更好的使用Rails5进行开发。 ApplicationRecord 在Rails4中所有的模型都继承自ActiveRecord::Base,不过在Ra 阅读全文
posted @ 2021-08-26 16:18 鞋带松了 阅读(32) 评论(0) 推荐(0) 编辑
摘要: 仅仅用于保存,方便下次参考 https://www.bootstrapdash.com/free-bootstrap-simple-admin-templates/ https://athemes.com/collections/free-bootstrap-admin-templates/ 阅读全文
posted @ 2021-08-26 16:12 鞋带松了 阅读(38) 评论(0) 推荐(0) 编辑