码迷,mamicode.com
首页 >  
搜索关键字:function    ( 54714个结果
关于函数的参数
废话少说直接上代码function add(x, y) { var total = x + y; alert(total); return total;}add(5,10);//15这里是会弹出来 15 的但是如果这样的add(2,3,4,5);这样调用会出现什么??答案是 5 (对,...
分类:其他好文   时间:2015-06-11 16:52:15    阅读次数:78
javascript 对象 工厂方式和构造函数
1.一个简单的代码function s(names){this.name=names;this.showname=functoin(){ alert(this.name);}} //工厂方式new s("张三").showname(); // 函数中 'this' 的理解
分类:编程语言   时间:2015-06-11 16:40:41    阅读次数:113
javascript 实现页面加载完再显示页面
document.onreadystatechange = function () { if (document.readyState == "complete") { document.body.style.display = "block"; ...
分类:编程语言   时间:2015-06-11 16:34:30    阅读次数:186
js的运动框架
1 /** 2 * Created by zhouhaiou on 2015/6/10. 3 */ 4 5 6 // 封装获取id的方法 7 function $(id){ 8 return document.getElementById(id); 9 }10 11 // 封装获取...
分类:Web程序   时间:2015-06-11 16:24:45    阅读次数:161
c# 下拉多选的实现
1.首先是个TextBox▼2.在TextBox上注册一个点击事件用来显示下拉框如下:function showDiv(divID, txtID) {var oSelect = document.getElementById(divID);var oText = document.getElemen...
分类:Windows程序   时间:2015-06-11 16:17:22    阅读次数:158
Leetcode 1 Two Sum
Given an array of integers, find two numbers such that they add up to a specific target number.The function twoSum should return indices of the two nu...
分类:其他好文   时间:2015-06-11 16:12:11    阅读次数:104
工作积累(六)——jQuery实现DOM元素事件绑定
用jQuery为DOM元素绑定事件时,如果用下面这种方式:<buttonclass="dynamic-bind">按钮一</button> $(function(){ $(‘.dynamic-bind‘).on(‘click‘,function(e){ alert(e.type);//’click’ }); });那么如果在绑定事件之后通过jQuery添加与该选择器相同的新的DOM元..
分类:Web程序   时间:2015-06-11 14:58:31    阅读次数:118
Jquery绑定事件
jquery中用on来绑定事件,经常的写法有$(document).on(‘click‘,‘.classname‘,function(){});$(‘.classname‘).on(‘click‘,function(){});上面两种都是给类是classname的元素添加了click事件等同于bind()
分类:Web程序   时间:2015-06-11 14:52:02    阅读次数:152
chorme浏览器div包含img标签页面总超出浏览器页面高度
<divstyle="display:block;position:absolute;left:0px;top:0px;"id="backgroundImg"><imgsrc="img/zx-user-login/2.jpg"style="width:100%;height:100%;"/></div> js如下: $(function(){ $(document).ready(function(){ alert($(window).width()+","+$(..
分类:其他好文   时间:2015-06-11 14:51:02    阅读次数:130
Ajax的jsonp方式跨域获取数据
jsonp的调用,今天碰到了,正好整理了一下。 $(document).ready(function(){ $("#b01").click(function(){ $.ajax({//danielinbiti.txt文件内容:getAInfo([""]) url: 'http://192.168.12.21:8080/systemr/danieli...
分类:Web程序   时间:2015-06-11 14:39:31    阅读次数:176
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!