/js中参数的传递之数值传递 //这次传递相当于将count的值拷贝了一份给num,num的改变并不影响count(两块不同的内存区域) function addTen(num){ num += 10; return num; } var count = 20; var result = addTe ...
分类:
Web程序 时间:
2016-08-16 21:55:46
阅读次数:
202
<body> <div id="date"></div> </body> <script type="text/javascript"> function getTime () { var now = new Date(); var future = new Date("01/01/2018 00: ...
分类:
其他好文 时间:
2016-08-16 21:42:05
阅读次数:
149
Given an arbitrary ransom note string and another string containing letters from all the magazines, write a function that will return true if the rans ...
分类:
其他好文 时间:
2016-08-16 20:21:05
阅读次数:
123
首先说明一下错误写法每次都弹出5的原因: for(var i=1;i<=4;i++){ //给下面这行的i叫“第一个i” $("#addShopCar"+i).click(function () { //给下面这行的i叫“第二个i” alert(i); }) } 其实原因就是每次循环里,第一个i是确 ...
分类:
其他好文 时间:
2016-08-16 20:12:18
阅读次数:
100
代码: 1 /** 2 * Created by Administrator on 2016/8/12. 3 */ 4 (function () { 5 6 var url = "http//baidu.com#a=你好&b=world"; 7 var url1 = "http//baidu.com ...
分类:
其他好文 时间:
2016-08-16 20:04:35
阅读次数:
114
var p = [ {name:"kitty", age:12}, {name:"sonny", age:9}, {name:"jake", age:13}, {name:"fun", age:24} ] function down(x, y) { return (x.age < y.age) ? ...
分类:
编程语言 时间:
2016-08-16 19:53:23
阅读次数:
201
1、HDU 2824 The Euler function 2、链接:http://acm.hdu.edu.cn/showproblem.php?pid=2824 3、总结:欧拉函数 题意:求(a,b)间的欧拉函数值的和。 #include<iostream> #include<cstring> # ...
分类:
其他好文 时间:
2016-08-16 16:15:20
阅读次数:
181
第一种模式:工厂方式 var lev=function(){ return "脚本之家"; }; function Parent(){ var Child = new Object(); Child.name="脚本"; Child.age="4"; Child.lev=lev; return Ch ...
分类:
Web程序 时间:
2016-08-16 16:01:59
阅读次数:
198
publicfunctionPost($data,$target){$url_info=parse_url($target);$httpheader="POST".$url_info[‘path‘]."HTTP/1.0\r\n";$httpheader.="Host:".$url_info[‘host‘]."\r\n";$httpheader.="Content-Type:application/x-www-form-urlencoded\r\n";$httpheader.="Content-Length:"..
分类:
Web程序 时间:
2016-08-16 14:52:01
阅读次数:
227
<!--第一种方法--> <script type="text/javascript"> function sort (arr) { for (var i = 0;i<arr.length;i++) {// 比较相邻的元素。如果第一个比第二个大,就交换他们两个。// (1). 从第一项开始, 依次与 ...
分类:
编程语言 时间:
2016-08-16 13:21:13
阅读次数:
186