javascript不能支持函数的重载,如下:function f(length) {
alert("高为:"+length); } function f(length,width) {
alert("高为:"+length+",宽为:"+width); } 上面那段代码其实是行不通...
分类:
Web程序 时间:
2014-05-12 04:18:43
阅读次数:
407
1、格式化字符串操作String.prototype.format = function(args)
{ if (arguments.length>0) { var result = this; if (arguments.length == 1
&& typeof (args) == "objec...
分类:
编程语言 时间:
2014-05-12 04:17:43
阅读次数:
314
把对象当参数传递给方法,在方法里改过对象后,影响到外面的对象
因为对象是引用传递过去的class Book { public $name; public function __construct($name) {
$this->name = (string)$n...
分类:
Web程序 时间:
2014-05-12 03:34:37
阅读次数:
386
在开发的过程中,我们经常要输出一下变量看看得到的结果是什么,我们就要根据变量的类型选择使用echo,print_r或者var_dump,brophp框架中的p()函数会自动根据变量类型选择用什么方法为我们输出变量,所以我收藏了
function p() { $args=func_...
分类:
其他好文 时间:
2014-05-12 02:59:51
阅读次数:
298
javascript解释器中存在一种变量声明被提升(hoisting)的机制,即变量(函数)的声明会被提升到作用域的最前面。即使把声明代码写在最后面。
alert(foo); //function foo(){} alert(bar); //undefined var bar = func...
分类:
编程语言 时间:
2014-05-12 00:42:19
阅读次数:
369
Option Explicit
Function stripHTML(strtext)
dim arysplit,i,j, strOutput
arysplit=split(strtext,"
if len(arysplit(0))>0 then j=1 else j=0
for i=j to ubound(arysplit)
if instr(arysplit(i),">") ...
分类:
其他好文 时间:
2014-05-11 21:56:06
阅读次数:
355
右键弹出自定义菜单,很有意思呀!
右键菜单
function showmenuie5(){
var rightedge=document.body.clientWidth-event.clientX
var bottomedge=document.body.clientHeight-event.clientY
if (rightedge
ie5menu.style.left=d...
分类:
其他好文 时间:
2014-05-11 20:20:35
阅读次数:
240
$(document).ready(function () { var
tag=$(".tags"); tag.mouseover(function(){
$(this).addClass("tagOn").siblings().removeClass("tagOn"); var index ...
分类:
Web程序 时间:
2014-05-11 18:22:45
阅读次数:
415
function getElementsByClassName(str,root,tag){
if(root){ root = typeof root == "string" ? document.getElementById(root) : root;
} els...
分类:
编程语言 时间:
2014-05-11 18:20:00
阅读次数:
316
C++语言的对象化模型.封装,隐藏内部实现.继承,复用现有代码.多态,改写对象行为本文描述了一个C++实现的继承和多态的场景,然后用C语言编写了一种对等的实现。//
A typical example of inheritance and virtual function use.// We wou...
分类:
编程语言 时间:
2014-05-11 18:03:47
阅读次数:
412