1.页面加载就调用的函数 window.onload = function(){ //这里的代码将在页面准备就绪之后开始执行} 此为js写法等价于下面jquery写法 $(window).load(function() { $("#btn-upload").click(function(){ //比 ...
分类:
Web程序 时间:
2016-05-13 08:37:30
阅读次数:
179
jQuery 页面加载初始化的方法有3种 ,页面在加载的时候都会执行脚本,应该没什么区别,主要看习惯吧,本人觉得第二种方法最好,比较简洁。 第一种: [javascript] view plain copy $(document).ready(function(){ alert("第一种方法。"); ...
分类:
Web程序 时间:
2016-05-13 08:32:01
阅读次数:
137
Write a function that takes a string as input and reverse only the vowels of a string. Example 1:Given s = "hello", return "holle". Example 2:Given s ...
分类:
编程语言 时间:
2016-05-13 08:30:04
阅读次数:
197
Given an integer (signed 32 bits), write a function to check whether it is a power of 4. Example:Given num = 16, return true. Given num = 5, return fa ...
分类:
编程语言 时间:
2016-05-13 08:24:17
阅读次数:
142
//循环function addList(data){ var $ul = $('.list ul'); for(var i= 0,l=data.length; i<l; i++){ var tmpdata = data[i]; var $li = $('<li></li>'); $li.html( ...
分类:
其他好文 时间:
2016-05-13 08:07:17
阅读次数:
112
Write a function that takes a string as input and returns the string reversed. Example:Given s = "hello", return "olleh". 个人博客:http://www.cnblogs.com/ ...
分类:
编程语言 时间:
2016-05-13 08:04:23
阅读次数:
124
Date.prototype.format=function (){var s='';s+=this.getFullYear()+'-';// 获取年份。s+=(this.getMonth()+1)+"-"; // 获取月份。s+= this.getDate(); // 获取日。return(s); ...
分类:
其他好文 时间:
2016-05-13 07:41:12
阅读次数:
170
用类封装数据库连接(unionsql-class.php) 用函数封装数据库连接(unionsql-function.php) ...
分类:
数据库 时间:
2016-05-13 07:38:05
阅读次数:
193
$(function(){ //获取要定位元素距离浏览器顶部的距离 var navH = $(".win").offset().top; //滚动条事件 $(window).scroll(function(){ //获取滚动条的滑动距离 var scroH = $(this).scrollTop() ...
分类:
Web程序 时间:
2016-05-13 07:29:24
阅读次数:
152
单例模式:只允许实例化一次的对象类
这种在基本的编程中可能已经经常的用到,只是不知道是单例模式
比如config.js文件,service.js里都会经常用到:app.factory('payInfo', function($location) {
// Might use a resource here that returns a JSON array
return {
ge...
分类:
编程语言 时间:
2016-05-13 04:33:49
阅读次数:
144