原创 鼠標點擊複製內容

<input type="text" id="short_url_input" value="我是複製的內容"> <button id="cpbtn" type="button" data-clipboard-target="#short

原创 點擊追加以及刪除

<form method="post" action="obj.php"> <input type="hidden" name="habays" id="habays" value="" /> <div id="objD

原创 HTTP請求方式辨別

/** * 是否POST方式請求而來的 * @return boolean */ public function isPost(){ if(isset($_SERVER['REQUEST_METHOD']) && $_SERVER

原创 jsonp跨域

//一,客戶端代碼示例 $("#btn").click(function(){ var j = $("form").serialize();//序列化name/value $.ajax({ url:"http://www.j

原创 JQ實現數字滾動顯示

/*文章數*/ .zsNum{line-height:24px; width:1000px; height:68px;overflow: hidden;margin: 10px auto;} .zsNum span{float:left;

原创 JS整理

/** * 判斷圖片是否加載完畢,顯示默認圖片 * @param {type} imgObj * @returns {undefined} */ function imgLoad(imgObj){ im

原创 PHP實現文字寫入圖片

/** * PHP實現文字寫入圖片 */ class wordsOnImg { public $config = null; /** * @param $config 傳入參數 * @para

原创 textarea最多輸入的長度

<textarea rows="3" cols="20" id='num' onKeyUp="showLen(this);"></textarea><span>還可以輸入<font color='red' id="font" rel="2

原创 php遠程抓取網站圖片並保存

/** * 一個用於抓取圖片的類 */ class download_image{ //抓取圖片的保存地址 public $save_path; //抓取圖片的大小限制(單位:字節) 只抓比size比這個限制大

原创 //JQ操作文本域和下拉選項的值

<form method="post"> <select id="HookEct"> <option value="1">選項一</option> <option value="2">選項二</option> <option

原创 M端滾動異步加載數據

var currentPage =1; //默認頁 var pages = {:$pageNum:}; //總頁數 function nextPage(){ if (pages == 0){ return; } currentP

原创 redis在windows下安裝操作

以下操作是基於redis3.0.5的版本在windows系統下的命令 安裝到服務: redis-server --service-install redis.windows.conf 啓動命令: redi

原创 js正則操作

1. ^\d+$  //匹配非負整數(正整數 + 0) 2. ^[0-9]*[1-9][0-9]*$  //匹配正整數 3. ^((-\d+)|(0+))$  //匹配非正整數(負整數 + 0) 4. ^-[0-9]*[1-9][0

原创 PHP操作MongoDB

//MongoDB的配置 $MONGO_SERVER = array( 'host'=>'127.0.0.1', 'port'=>27017, 'dbname'=>'app', 'user'=>'',

原创 php常用函數

/** * 獲取指定日期段內每一天的日期 * @param Date $startdate 開始日期 * @param Date $enddate 結束日期 * @return Array */ function g