This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* 异步提交表单 | |
* @param object form 表单DOM对象 | |
* @return void | |
*/ | |
var ajaxSubmit = function(form) { | |
var args = M.getModelArgs(form); | |
M.getJS(THEME_URL + '/js/jquery.form.js', function() { | |
var options = { | |
dataType: "json", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* 数组去重 | |
* @param array arr 去重数组 | |
* @return array 已去重的数组 | |
*/ | |
var unique = function(arr) | |
{ | |
var obj = {}; | |
for(var i = 0, j = arr.length; i < j; i++) { | |
obj[arr[i]] = true; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<input type="text" class='user' value='用户名 仅英文或数字' onfocus="if(this.value=='用户名 仅英文或数字'){this.value=''}" onblur="if(!$.trim(this.value)){this.value='用户名 仅英文或数字'}"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var flag = true; | |
$.ajax({ | |
type: "POST", | |
async:false, | |
cache:false, | |
url: "{:U('Public/checkEmail')}", | |
data:{email:$("#email").val()} | |
}).done(function(data) { | |
if(parseInt(data)==1){ | |
ui.error('该邮箱已注册'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var flag = false; | |
$(window).scroll(function() { | |
console.log(flag); | |
if(flag){ | |
return false; | |
} | |
if($(window).scrollTop()==0){ | |
//恢复 | |
flag = true; | |
$(".sign").fadeOut('100',function(){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function fsockopen_test(){ | |
$hostname = 'm.cn'; | |
$url = '/bbb/2.php'; | |
$fp = fsockopen($hostname, 80, $errno, $errstr, 5); | |
if (!$fp) { | |
echo "$errstr ($errno)"; | |
return false; | |
} | |
$header = "GET $url HTTP/1.1\r\n"; | |
$header.="Host: $hostname\r\n"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* description : null | |
* @author : zhoumengkang | |
* createTime : 15/2/14 10:12 | |
*/ | |
define("TOKEN", "weixin"); | |
$wechatObj = new weChat(); | |
class weChat{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*! | |
* HeadJS The only script in your <HEAD> | |
* Author Tero Piirainen (tipiirai) | |
* Maintainer Robert Hoffmann (itechnology) | |
* License MIT / http://bit.ly/mit-license | |
* | |
* Version 0.99 | |
* http://headjs.com | |
*/ | |
/* modify : head ==> Wind */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class Cache | |
{ | |
private static $instance = array(); | |
/** | |
* 缓存实例化的工厂方法并且确保单例 | |
*/ | |
public static function getInstance( $type,$options=array()){ | |
$type = strtolower(trim($type)); |
OlderNewer