document.getElementById("test").onclick = function(){ ...};
分类:
编程语言 时间:
2015-07-02 23:53:59
阅读次数:
150
在JavaScript中创建自定义对象都需要用new运算符,那么创建对象的过程是什么样的呢?例如现在有如下构造函数:function Person(name) { this.name = name;}Person.prototype = { constructor: Person, ...
分类:
编程语言 时间:
2015-07-02 23:52:34
阅读次数:
179
#!/bin/bash
#斐波那契数列
#不要用递归,深度大于30就老火了。
function fun_test()
{
if [ $1 -lt 3 ];then
echo 1
return
fi
sum1=1
sum2=1
let count=$1-2
sum=0
while [ $count -gt 0 ];...
分类:
系统相关 时间:
2015-07-02 22:37:24
阅读次数:
238
Given a binary search tree, write a function kthSmallest to find the kth smallest element in it.Note:
You may assume k is always valid, 1 ≤ k ≤ BST’s total elements.Follow up:
What if the BST is mod...
分类:
其他好文 时间:
2015-07-02 22:37:12
阅读次数:
129
/** * 数字转中文 * @param dValue * @returns */function chineseNumber(dValue) { var maxDec = 2; // 验证输入金额数值或数值字符串: dValue = dValue.toString().repla...
分类:
Web程序 时间:
2015-07-02 21:05:21
阅读次数:
194
随着互联网时代的发展,web前端已经和后台数据挂钩,作为web前端仅仅不是只切图写写html,css 和简单js交互。js code 1 $(function() { 2 var page = 1; 3 var discount = $('#discount'); 4 ...
分类:
Web程序 时间:
2015-07-02 21:01:31
阅读次数:
163
前台页面 内容: 字体大小: 文字背景图: 字体颜色: 下载图片 View Code后台代码 function imglist(){ $this->display(); } function imglis...
分类:
其他好文 时间:
2015-07-02 20:58:17
阅读次数:
125
dsql = $dsql; } function __construct() { $this->tenpay(); } /** * 设定接口会送地址 * * 例如: $this->SetReturnUrl($cfg_baseho...
分类:
Web程序 时间:
2015-07-02 19:27:23
阅读次数:
172
1、call()和apply(),实例如下:function add(a,b){ alert(a+b);}function sub(a,b){ alert(a-b);}add.call(sub,3,1);说明:这个例子中的意思就是用 sub继承add,add.call(sub,3,1) == add...
分类:
编程语言 时间:
2015-07-02 19:26:05
阅读次数:
117
不完整,未全部测试function remove_img_a(str){ var reg1 = /]+[\s]+)href=(\"([^"\']*)\"|\'([^"\']*)\')[^]*>/gi; var reg2 = /\w+(]*>)\w+(]*>)\w+/g; var a...
分类:
其他好文 时间:
2015-07-02 19:17:32
阅读次数:
120