码迷,mamicode.com
首页 >  
搜索关键字:function    ( 54714个结果
JavaScript对象的创建之工厂方法
通过工厂的方式来创建Person对象,在createPerson中创建一个对象,然后为这个对象设置相应的属性和方法,之后返回这个对象。function createPerson(name, age){ var obj = new Object(); obj.name = name; ...
分类:编程语言   时间:2014-09-03 19:34:37    阅读次数:268
jquery插件
这里有一个简单的插件的例子,也是我从jquery基础教程2里面摘抄的 1、jquery.slidefade.js插件 jQuery.fn.slideFadeOut = function(speed, callback) { return this.animate({ height: ‘hide‘, opacity: ‘hide‘ }...
分类:Web程序   时间:2014-09-03 18:31:07    阅读次数:219
JavaScript对象的创建之外部属性定义方式(基于已有对象扩充其属性和方法)
var person = new Object();person.name = "luogk";person.age = 33;person.say = function(){ alert(this.name + " , " + this.age);//this表示的是调用的对象即person...
分类:编程语言   时间:2014-09-03 18:04:46    阅读次数:186
《JS弹出页面》
一.引入两个文件1.macco.js(function ($) { var macco = { debug: true, // arguments : all // console.log log: function () { var a = window.console, b = argument...
分类:Web程序   时间:2014-09-03 18:04:37    阅读次数:612
页面传递Json对象,后台解析
使用的组件 前台组件:json2.js  来自 http://www.json.org/js.html 后台组件:json-lib-2.2.2-jdk15.jar 前台代码 1 通过页面生成json对象列表,然后转换成字符串 // 生成json对象 转字符串 function makeTsJsonParam(){ var tsList = new Array(); ...
分类:Web程序   时间:2014-09-03 16:55:57    阅读次数:194
jquery和highcharts折线图、柱形图、饼状图-模拟后台传参源码
js代码: $(function(){ showLine(); showColumn(); showPie(); }); function showPie(){ jQuery.ajax({ type: "get", url: "csylLine.json", async: false, dataType: "jso...
分类:Web程序   时间:2014-09-03 16:52:46    阅读次数:189
javascript中match和RegExp组合用法
function getCookie(name)//取cookies函数 { //coook中document.cookie = "age=12; name=1.css"; var arr = document.cookie...
分类:编程语言   时间:2014-09-03 16:39:36    阅读次数:216
iframe自适应高度的方法
不带边框的iframe因为能和网页无缝的结合从而不刷新新页面的情况下实现更新页面部分的数据成为可能,可是iframe却不像层那样可以收缩自如,iframe高度需要动态的调整需要JS来配合使用,只能通过JS动态的来赋给他高度。function SetWinHeight(obj) { var win.....
分类:其他好文   时间:2014-09-03 16:18:46    阅读次数:208
js 中的call(this)问题
原因:我在看underscore的源码时,看到大的框架是().call(this);所以想看一下call(this)的用法,在网上找了这篇帖子:http://i.h-won.com/post/2013-08-29/40052244462,不过还没看懂,所以先记录一下。疑惑的地方是:(function...
分类:Web程序   时间:2014-09-03 12:38:16    阅读次数:229
Write a program to convert string to number without using library function。
/* Write a program that prints the numbers from 1 to 100,but for  multiples of three print “Fizz” instead of the number and for the multiples of five print "Buzz". For numbers which are multiples of...
分类:其他好文   时间:2014-09-03 11:19:16    阅读次数:221
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!