2009年6月4日
2009年6月3日
花了两个小时终于把discuz的编辑器给抠下来了
这个编辑器挺不错的~简洁漂亮
文件连接是 /Files/three/discuzeditor.rar
2009年4月5日
phpeclipse 之前的安装地址已经失效,如果要按照请从地址进行安装
安装方式和以前一样
点击进入目录之后,自己选择一个地址进行安装
http://phpeclipse.sourceforge.net/update/
你可以直接选择
http://phpeclipse.sourceforge.net/update/stable/1.2.x/
2009年4月1日
之前参考过某位大侠的讲解,不过稍微复杂,看得我眼冒金星,不过似乎还是有收获的,因此自己写一个类似的实现功能
子域名通过父域名的代理访问父域名的内容
子域通过父域的iframe文件返回需要的内容
子域应用文件 a.html
<!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=gb2312" />
<title>子域应用</title>
<script language="javascript">
document.domain = "1626.com";
window._isIE = (navigator.appName == "Microsoft Internet Explorer");
if(window._isIE) {
if(navigator.userAgent.indexOf("Opera")>-1) window._isIE = null;
if(navigator.userAgent.indexOf("Firefox")>0) window._isIE = null;
if(navigator.userAgent.indexOf("Windows NT 6.0")>-1) window._isVista = true;
else window._isVista = false;
}
else {
if(navigator.userAgent.indexOf("Gecko")==-1) window._isIE = null;
if(navigator.userAgent.indexOf("Firefox")>0) window._isIE = null;
}
function $(_sId) {
return document.getElementById(_sId);
}
function ajaxload(Url, typeGet, htmlDiv) {
$(htmlDiv).innerHTML = "loading...";
if (window.XMLHttpRequest) {
xmlHttp = new XMLHttpRequest();
} else {
if (window.ActiveXObject) {
xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
} else {
return;
}
}
xmlHttp.onreadystatechange = function () {
if (xmlHttp.readyState == 4) {
loaded(xmlHttp.responseText, htmlDiv);
}
};
switch (typeGet.toUpperCase()) {
case "GET":
xmlHttp.open("GET", Url, true);
xmlHttp.send(null);
break;
case "POST":
xmlHttp.open("POST", Url, true);
xmlHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded;");
var querystring = Url;
xmlHttp.send(querystring);
break;
default:
break;
}
}
function loaded(responseText, htmlDiv) {
$(htmlDiv).innerHTML = responseText;
}
function getHtml()
{
if(window._isIE) {
window.frames["iframeProxy"].ajaxload('text.txt',"GET",'boom');
}else{
$('iframeProxy').contentWindow.ajaxload('text.txt',"GET",'boom');
}
}
</script>
</head>
<body>
<input type="button" value="Request" onclick="getHtml()" />
<div id="boom"></div>
<iframe src="DomainProxy.html" id="iframeProxy" style="display:none"></iframe>
</body>
</html>
父域代理文件
<!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=gb2312" />
<title>父域代理</title>
<script language="javascript">
document.domain = "1626.com";
function $(_sId) {
return document.getElementById(_sId);
}
function ajaxload(Url, typeGet, htmlDiv) {
$(htmlDiv).innerHTML = "loading...";
if (window.XMLHttpRequest) {
xmlHttp = new XMLHttpRequest();
} else {
if (window.ActiveXObject) {
xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
} else {
return;
}
}
xmlHttp.onreadystatechange = function () {
if (xmlHttp.readyState == 4) {
loaded(xmlHttp.responseText, htmlDiv);
}
};
switch (typeGet.toUpperCase()) {
case "GET":
xmlHttp.open("GET", Url, true);
xmlHttp.send(null);
break;
case "POST":
xmlHttp.open("POST", Url, true);
xmlHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded;");
var querystring = Url;
xmlHttp.send(querystring);
break;
default:
break;
}
}
function loaded(responseText, htmlDiv) {
parent.loaded(responseText, htmlDiv);//返回给子域代理
}
</script>
</head>
<body>
<div id="boom"></div>
</body>
</html>
adobe系列的产品,总体上都非常让人满意
不过ps切图导出(当然不需要ps导出的另说)html的时候有一个结果令人不满意
为什么不满意呢?因为ps导出的html是先写标题而不是先声明编码,
这有什么问题?
问题在于 不同页面跳转之间出现空白页面的情况 (也是针对中文而言)
例如这个 :
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>简单高效的javascript 幻灯片播放</title>
如果你换成:
<title>简单高效的javascript 幻灯片播放</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
你的页面将会一篇空白,因为浏览器面对中文会自动选择 GB2312编码
而页面声明的编码确实utf-8;当然你的页面就会无法正常显示了
见过不少javascript 幻灯片播放效果,觉得太复杂了,自己编写一个简单。
css滤镜效果暂时不支持 firfox
全部代码如下,图片路径需要自己修改
<!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-8" />
<title>简单高效的javascript 幻灯片播放</title>
</head>
<body>
<div>
<div id="divs">
<img src="images/1.jpg" id="1" style="FILTER: revealTrans(duration=2,transition=16); cursor:pointer;" onclick="location.href = 'http://www.1626.com'">
<img src="images/2.jpg" id="2" style="FILTER: revealTrans(duration=2,transition=17); cursor:pointer;display:none" onclick="location.href = 'http://www.1626.com'">
<img src="images/3.jpg" id="3" style="FILTER: revealTrans(duration=2,transition=18); cursor:pointer;display:none" onclick="location.href = 'http://www.1626.com'">
<img src="images/4.jpg" id="4" style="FILTER: revealTrans(duration=2,transition=19); cursor:pointer;display:none" onclick="location.href = 'http://www.1626.com'">
<img src="images/5.jpg" id="5" style="FILTER: revealTrans(duration=2,transition=20); cursor:pointer;display:none" onclick="location.href = 'http://www.1626.com'">
<img src="images/6.jpg" id="6" style="FILTER: revealTrans(duration=2,transition=21); cursor:pointer;display:none" onclick="location.href = 'http://www.1626.com'">
</div>
<script language="javascript">
function $(_sId) {
return document.getElementById(_sId);
}
var speed=3000;
var setid=null;
var auto="true";
function galleryplay(divs,a,mtime){ //t为要应用此函数的id,a初始化时显示的项目的顺序数
if(divs=="0")return false;
var start=3;
if(auto=="true")
{
start = a-1;//初始项目
speed = mtime;//切换间隔
setid = null;//定时器
var loop = function(){ //自动切换
ids = divs.split(",");
for (var i=0;i<ids.length; i++)
{
$(ids[i]).style.display='none';
}
$(ids[start]).filters.revealTrans.Transition = Math.floor(Math.random() * 23);
$(ids[start]).filters.revealTrans.apply();
$(ids[start]).filters.revealTrans.play();
$(ids[start]).style.display='';
setid=setTimeout(loop,speed);
start++;
if(start==ids.length){
start=0;
}
};loop();
}
}
galleryplay('1,2,3,4,5,6',1,3000);
</script>
</div>
</body>
</html>
2008年3月18日
函数:
function RequestmainList(url,divh,divs)
@url 被调用的url 可以带参数
@divh 当前需要处理的div,也是目前div
@divs 状态div 例如loading......
调用示例:
RequestmainList('url.........','mainlist','loading')
/*ajax 对象 只要用于加载相册内 图片列表
*
*
*/
var xmlHttp;
function creatXMLHttpRequest() {
if(window.XMLHttpRequest) {
//xmlHttp = new XMLHttpRequest();
xmlHttp = new XMLHttpRequest();
if (xmlHttp.overrideMimeType)
{
xmlHttp.overrideMimeType('text/XML');
}
}
else if(window.ActiveXObject)
{
try
{
xmlHttp = new ActiveXObject("MsXML2.XMLHTTP");
}
catch (e)
{
try
{
xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
}
catch (e) {}
}
xmlHttp = new ActiveXObject('Microsoft.XMLHTTP');
}
if (!xmlHttp)
{
alert('你的浏览器不支持本系统的某些服务:(');
return false;
}
}
/********************************/
/*
* 页面列表请求
*/
var divhidden;
var divshow;
function RequestmainList(url,divh,divs) {
divhidden=divh;
divshow=divs;
document.getElementById(divs).style.display = "";
var queryString;
queryString = url;
creatXMLHttpRequest();
xmlHttp.open("get",url,"true");
xmlHttp.onreadystatechange = pageupdate;
xmlHttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded;");
xmlHttp.send(queryString);
}
function pageupdate()
{
if(xmlHttp.readyState == 1)
{
document.getElementById(divhidden).style.display = "";
}
if(xmlHttp.readyState == 4)
{
if(xmlHttp.status == 200)
{
document.getElementById(divhidden).style.display = "";
document.getElementById(divshow).style.display = "none";
var responseText = xmlHttp.responseText;
document.getElementById(divhidden).innerHTML = responseText;
}
}
}
/*******************************/
改进了朋友的一个ajax,可以莫非简单的并发效果
/**
*作者:rock
*Email:lanshikun2008@163.com
*时间:2008年03月06日
*/
function Ajax(callback,t)
{
this.xmldoc = getXMLDOC(); //获得XMLHttpRequest对像
this.callback = callback; //回调方法
this.backType = t; //返回值的类型1:text;其它为XML
this.Post = post;
this.Get = get;
}
function get(url,para)
{
var ajax = this;
function CheckState()
{
if(xmldoc.readyState == 4){
if(xmldoc.status == 200){
if(ajax.backType==1)
{
ajax.callback(4,200,xmldoc.responseText);
}
else
{
ajax.callback(4,200,xmldoc.responseXML);
}
}else
{
ajax.callback(4,xmldoc.status,null);
}
}
else
{
ajax.callback(xmldoc.readyState,null,null);
}
}
xmldoc.onreadystatechange = CheckState;
xmldoc.open('GET',url+"?"+para,true);
xmldoc.setRequestHeader("Content_Type","application/x-www-form-urlencoded;charset=utf-8");
xmldoc.setRequestHeader("Cache-Control","no-cache");
xmldoc.send("");
}
function post(url,para)
{
var ajax = this;
function CheckState()
{
if(xmldoc.readyState == 4){
if(xmldoc.status == 200){
if(ajax.backType==1)
{
ajax.callback(4,200,xmldoc.responseText);
}
else
{
ajax.callback(4,200,xmldoc.responseXML);
}
}else
{
ajax.callback(4,xmldoc.status,null);
}
}
else
{
ajax.callback(xmldoc.readyState,null,null);
}
}
xmldoc.onreadystatechange = CheckState;
xmldoc.open('POST',url,true);
xmldoc.setRequestHeader("Content_Type","application/x-www-form-urlencoded;charset=utf-8");
xmldoc.send(para);
}
function getXMLDOC()
{
//Mozill,Safari等浏览器时需要创建的XMLHttp类
if(window.XMLHttpRequest){
xmldoc = new XMLHttpRequest();
if(xmldoc.overrideMimeType){
xmldoc.overrideMimeType('text/xml');
}
}
//IE浏览器时创建的XMLHttp类
else if(window.ActiveXObject){
try{
xmldoc = new ActiveXObject("Msxml3.XMLHTTP");
}
catch(e){
try{
xmldoc = new ActiveXObject("Msxml2.XMLHTTP");
}
catch(e){
try{
xmldoc = new ActiveXObject("Microsoft.XMLHTTP");
}
catch(e){}
}
}
}
//不能创建XMLHTTP类时返回
if(! xmldoc){
alert("无法创建XMLHttp对象!");
document.location.reload();
}
return xmldoc;
}
function M_Request()
{
this.id=false;
this.url=false;
}
function start(url,ids){//初始化
var a_Request = new Array();
id = ids.split(",");//拆分ids
for (var i=0; i<id.length; i++)
{
if(document.getElementById(id[i]))
{
document.getElementById(id[i]).innerHTML = "Loading....";
var m_Request = new M_Request();
m_Request.url = url+id[i];
m_Request.id = id[i];
a_Request[a_Request.length] = m_Request;
}
}
var tmp_array = new Array();
tmp_array[0] = a_Request;
tmp_array[1] = 0;
goLoadBack(tmp_array);
}
function goLoadBack(tmp_array)
{
var a = tmp_array[0];
var c_length = tmp_array[1];
if (a.constructor == Array)
if (c_length+1<a.length)
{
function acallback(readyState,status,text)
{
if (readyState==4&&status==200)
{
document.getElementById(a[c_length].id).innerHTML = text;
tmp_array[1]=++c_length;
goLoadBack(tmp_array);
}
}
var ajax = new Ajax(acallback,1);
ajax.Post(a[c_length].url);
}
else
{
function bcallback(readyState,status,text)
{
if (readyState==4&&status==200)
{
document.getElementById(a[c_length].id).innerHTML = text;
}
}
var ajax = new Ajax(bcallback,1);
ajax.Post(a[c_length].url);
}
return;
}
函数解析:@被调用的url,目标div
function start(url,ids)
调用示例:
start('http://url','div,')
<!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=gb2312" />
<title> tabs with auto play function </title>
<meta name="Design Corp" content="Agenda" />
<meta name="robots" content="all" />
<script type="text/javascript">
<!--
function autoplay(divs,a,mtime)
{ //t为要应用此函数的id,a初始化时显示的项目的顺序数
this.start = a-1;//初始项目
this.speed = mtime;//切换间隔
this.setid = null;//定时器
var loop = function(){ //自动切换
this.obj="";
ids = divs.split(",");
for (var i=0;i<ids.length; i++)
{
document.getElementById(ids[i]).style.display = "none";
}
document.getElementById(ids[start]).style.display = "block";
setid=setTimeout(loop,speed);
start++;
if(start==ids.length){
start=0;
//clearTimeout(setid);//只循环一次
}
};loop();
}
//-->
</script>
</head>
<body onload="javascript:autoplay('7,8,9,10,11,12',3,3000);autoplay('13,14,15,16,17,18',3,1000)">
<div id="7" style="display:none">7</div>
<div id="8" style="display:none">8</div>
<div id="9">9</div>
<div id="10" style="display:none">10</div>
<div id="11" style="display:none">11</div>
<div id="12" style="display:none">12</div>
<div id="13" style="display:none">13</div>
<div id="14" style="display:none">14</div>
<div id="15">15</div>
<div id="16" style="display:none">16</div>
<div id="17" style="display:none">17</div>
<div id="18" style="display:none">18</div>
</body>
</html>
函数:
@div 要进行切换的div
@a 从第几个div开始
@mytime 切换时间
autoplay(divs,a,mtime)
调用方法
autoplay('7,8,9,10,11,12',3,3000);
2006年12月6日