摘要: <body> <script language="JavaScript"> function getCursorPos(event) { var obj= event.target||event.srcElement; if(document.selection){ if(obj.tagName!=undefined&&obj.tagName=='INPUT'){ var s=document.selection.createRange(); s.setEndPoint("StartToStart" 阅读全文
posted @ 2008-06-18 15:02 MultiThread-PHP 阅读(376) 评论(0) 推荐(0) 编辑
摘要: smarty_modifier_truncate,无或者有md_substr的情况下都能正确截取字符串的php函数,可用于smarty。function smarty_modifier_truncate($string, $length = 80, $etc = '...', $code='utf8', $mb=true) { if ($length == 0) return $string; if(function_exists("mb_substr")&&$mb){ if(mb_strlen($string,$code)& 阅读全文
posted @ 2008-06-18 11:12 MultiThread-PHP 阅读(916) 评论(0) 推荐(0) 编辑
摘要: JS:function divideContent(contentDomId,linkDomId){var maxCotentHeight = 600;var lineheight = parseInt(document.getElementById(contentDomId).style.lineHeight);maxCotentHeight = Math.ceil(maxCotentHeight/lineheight)*lineheight;document.getElementById(contentDomId).style.height = "";var conte 阅读全文
posted @ 2008-05-29 10:51 MultiThread-PHP 阅读(276) 评论(0) 推荐(0) 编辑
摘要: <?phpwhile(! ($dataFile = @fopen('http://www.phpwind.net/index-htm-cateid-1.html', "r" )) ){sleep(2);}//$dataFile = fopen('data.txt', "r" ) ;$buffer = '';if ( $dataFile ){$buffer = "";while (!feof($dataFile)) {$buffer .= fgets($dataFile, 4096) 阅读全文
posted @ 2008-05-16 12:34 MultiThread-PHP 阅读(313) 评论(0) 推荐(0) 编辑
摘要: 准备:1、prototype.js,http://prototype.conio.net/,用于ajax加载汉字字库2、汉字字库http://cn.minidx.com/index.php?option=com_docman&task=doc_download&gid=47----------------------------------------------------------------------------------------------------------------------------------------------<!DOCTYPE 阅读全文
posted @ 2008-05-11 20:47 MultiThread-PHP 阅读(2589) 评论(0) 推荐(0) 编辑
摘要: functionsptOps(str)...{varurl='/product/index/sa?'+str;varelement=document.createElement("script");element.setAttribute("language","javascript");element.setAttribute("src",url);document.body.appendChild(element);}实际就是把iframe换成script而已,效率高,代码简单,兼容性好 阅读全文
posted @ 2008-05-07 15:25 MultiThread-PHP 阅读(178) 评论(0) 推荐(0) 编辑
摘要: //JavaScriptDocument/**//**@paramact:1全选,2反选*@paramdom:checkbox名称*selectct记录被选中的数量*可以传入参数三和参数四;表示checkbox参数三属性值等于参数四时才进行全选、反选,否则跳过。*/varselectct=0;functiondoselect(act,dom)...{selectct=0;varobj=document.getElementsByTagName('input');for(vari=0;i<obj.length;i++)...{if(obj[i].type=='che 阅读全文
posted @ 2008-04-11 14:51 MultiThread-PHP 阅读(160) 评论(0) 推荐(0) 编辑
摘要: <?php function so($host,$port, $url, $extraData,&$errno,&$errstr,$method='GET'){ $fp = fsockopen($host, $port, $errno, $errstr, 30); if (!$fp) { echo "$errstr ($errno)<br /> "; return array('errstr'=>$errstr,'errno'=>$errno); } $out = "$m 阅读全文
posted @ 2008-04-07 11:56 MultiThread-PHP 阅读(471) 评论(0) 推荐(0) 编辑
摘要: <?php require 'Zend/Loader.php';Zend_Loader::loadClass('Zend_Cache');Zend_Loader::loadClass('Zend_Config');Zend_Loader::loadClass('Zend_Registry');$config = new Zend_Config_Ini('configsecr/config.ini');define('CACHE_DIR',FDROOT.'/'.'tmp/ 阅读全文
posted @ 2008-03-18 09:27 MultiThread-PHP 阅读(185) 评论(0) 推荐(0) 编辑
摘要: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=utf- 阅读全文
posted @ 2008-02-29 12:00 MultiThread-PHP 阅读(173) 评论(0) 推荐(0) 编辑