广州.NET俱乐部的活动
今天去参加广州.NET俱乐部的活动。下着毛毛的雨,本来不想去了,后来三明说去,然后就去了。
主要说了WPF Silverlight mobile开发
去到的时候,已经开始了,人很多。
WPF的DEMO很炫啊,看得我都完全心动,对视频的支持也非常好。有机会好好学。
Silverlight 讲得也不错。
彭斌依然很幽默,讲的mobile开发的DEMO很不错,自己对mobile开发也有那么一点点的了解了。
要学的东西好多啊!!!baxia!!
2013-07-02 18:43:19
不时,我需要某种机制,不断刷新网页,以提供一个实时的仪表板某种。如果我只能刷新一个特定的页面的一部分,这将是很大的,例如:仪表盘上的交通灯显示系统状态。
这是很容易通过使用jQuery JavaScript库,只刷新页面的一部分。一旦我们纳入我们的页面的jQuery库,我们只需要1行的JavaScript得到它的工作:
1 | < script src = "/js/jquery-1.3.2.min.js" type = "text/javascript" ></ script > |
所以我们只要我们的页面放入这个小的JS代码片段刷新里面的内容ID标签的一切,让我们说,每5秒:
1 2 3 | setInterval( function () { $( "#content" ).load(location.href+ " #content>*" , "" ); }, 5000); |
这就是它!!因此,这是很容易完成一些实时监控的行为,只是那行代码。没有更奇怪的元刷新标记或iframe一种解决方法,在Web应用程序。
每5秒,我们将刷新内容相同的URL和所有元素,驻留在元素ID为content元素的内容:内容。
2013-07-02 18:35:26
本文地址: jQuery Ajax 全解析
本文作者:QLeelulu
转载请标明出处!
jQuery确实是一个挺好的轻量级的JS框架,能帮助我们快速的开发JS应用,并在一定程度上改变了我们写JavaScript代码的习惯。
废话少说,直接进入正题,我们先来看一些简单的方法,这些方法都是对jQuery.ajax()进行封装以方便我们使用的方法,当然,如果要处理复杂的逻辑,还是需要用到jQuery.ajax()的(这个后面会说到).
1. load( url, [data], [callback] ) :载入远程 HTML 文件代码并插入至 DOM 中。
url (String) : 请求的HTML页的URL地址。
data (Map) : (可选参数) 发送至服务器的 key/value 数据。
callback (Callback) : (可选参数) 请求完成时(不需要是success的)的回调函数。
这个方法默认使用 GET 方式来传递的,如果[data]参数有传递数据进去,就会自动转换为POST方式的。jQuery 1.2 中,可以指定选择符,来筛选载入的 HTML 文档,DOM 中将仅插入筛选出的 HTML 代码。语法形如 "url #some > selector"。
这个方法可以很方便的动态加载一些HTML文件,例如表单。
示例代码:
$(".ajax.load").load("http://www.cnblogs.com/QLeelulu/archive/2008/03/30/1130270.html .post", function (responseText, textStatus, XMLHttpRequest){ this;//在这里this指向的是当前的DOM对象,即$(".ajax.load")[0] //alert(responseText);//请求返回的内容 //alert(textStatus);//请求状态:success,error //alert(XMLHttpRequest);//XMLHttpRequest对象 });
今天去参加广州.NET俱乐部的活动。下着毛毛的雨,本来不想去了,后来三明说去,然后就去了。
主要说了WPF Silverlight mobile开发
去到的时候,已经开始了,人很多。
WPF的DEMO很炫啊,看得我都完全心动,对视频的支持也非常好。有机会好好学。
Silverlight 讲得也不错。
彭斌依然很幽默,讲的mobile开发的DEMO很不错,自己对mobile开发也有那么一点点的了解了。
要学的东西好多啊!!!baxia!!
注:不知道为什么URL写绝对路径在FF下会出错,知道的麻烦告诉下。下面的get()和post()示例使用的是绝对路径,所以在FF下你将会出错并不会看到返回结果。还有get()和post()示例都是跨域调用的,发现传上来后没办法获取结果,所以把运行按钮去掉了。
2. jQuery.get( url, [data], [callback] ):使用GET方式来进行异步请求
参数:
url (String) : 发送请求的URL地址.
data (Map) : (可选) 要发送给服务器的数据,以 Key/value 的键值对形式表示,会做为QueryString附加到请求URL中。
callback (Function) : (可选) 载入成功时回调函数(只有当Response的返回状态是success才是调用该方法)。
这是一个简单的 GET 请求功能以取代复杂 $.ajax 。请求成功时可调用回调函数。如果需要在出错时执行函数,请使用 $.ajax。示例代码:
$.get("./Ajax.aspx", {Action:"get",Name:"lulu"}, function (data, textStatus){ //返回的 data 可以是 xmlDoc, jsonObj, html, text, 等等. this; // 在这里this指向的是Ajax请求的选项配置信息,请参考下图 alert(data); //alert(textStatus);//请求状态:success,error等等。
当然这里捕捉不到error,因为error的时候根本不会运行该回调函数 //alert(this); });
点击发送请求:
jQuery.get()回调函数里面的 this ,指向的是Ajax请求的选项配置信息:
3. jQuery.post( url, [data], [callback], [type] ) :使用POST方式来进行异步请求
参数:
url (String) : 发送请求的URL地址.
data (Map) : (可选) 要发送给服务器的数据,以 Key/value 的键值对形式表示。
callback (Function) : (可选) 载入成功时回调函数(只有当Response的返回状态是success才是调用该方法)。
type (String) : (可选)官方的说明是:Type of data to be sent。其实应该为客户端请求的类型(JSON,XML,等等)
这是一个简单的 POST 请求功能以取代复杂 $.ajax 。请求成功时可调用回调函数。如果需要在出错时执行函数,请使用 $.ajax。示例代码:
Ajax.aspx:
Response.ContentType = "application/json"; Response.Write("{result: '" + Request["Name"] + ",你好!(这消息来自服务器)'}");jQuery 代码:
$.post("Ajax.aspx", { Action: "post", Name: "lulu" }, function (data, textStatus){ // data 可以是 xmlDoc, jsonObj, html, text, 等等. //this; // 这个Ajax请求的选项配置信息,请参考jQuery.get()说到的this alert(data.result); }, "json");
点击提交:
这里设置了请求的格式为"json":
如果你设置了请求的格式为"json",此时你没有设置Response回来的ContentType 为:Response.ContentType = "application/json"; 那么你将无法捕捉到返回的数据。
注意一下,alert(data.result); 由于设置了Accept报头为“json”,这里返回的data就是一个对象,并不需要用eval()来转换为对象。
4. jQuery.getScript( url, [callback] ) : 通过 GET 方式请求载入并执行一个 JavaScript. 文件。
参数
url (String) : 待载入 JS 文件地址。
callback (Function) : (可选) 成功载入后回调函数。
jQuery 1.2 版本之前,getScript. 只能调用同域 JS 文件。 1.2中,您可以跨域调用 JavaScript. 文件。注意:Safari 2 或更早的版本不能在全局作用域中同步执行脚本。如果通过 getScript. 加入脚本,请加入延时函数。
这个方法可以用在例如当只有编辑器focus()的时候才去加载编辑器需要的JS文件.下面看一些示例代码:
加载并执行 test.js。jQuery 代码:
$.getScript("test.js");
加载并执行 AjaxEvent.js ,成功后显示信息。
jQuery 代码:
$.getScript("AjaxEvent.js", function(){ alert("AjaxEvent.js 加载完成并执行完成.你再点击上面的Get或Post按钮看看有什么不同?"); });
加载完后请重新点击一下上面的 Load 请求看看有什么不同。
jQuery Ajax 事件
Ajax请求会产生若干不同的事件,我们可以订阅这些事件并在其中处理我们的逻辑。在jQuery这里有两种Ajax事件:局部事件 和 全局事件。
局部事件就是在每次的Ajax请求时在方法内定义的,例如:
$.ajax({ beforeSend: function(){ // Handle the beforeSend event }, complete: function(){ // Handle the complete event } // ... });
全局事件是每次的Ajax请求都会触发的,它会向DOM中的所有元素广播,在上面 getScript() 示例中加载的脚本就是全局Ajax事件。全局事件可以如下定义:
$("#loading").bind("ajaxSend", function(){ $(this).show(); }).bind("ajaxComplete", function(){ $(this).hide(); });
或者:
$("#loading").ajaxStart(function(){ $(this).show(); });
我们可以在特定的请求将全局事件禁用,只要设置下 global 选项就可以了:
$.ajax({ url: "test.html", global: false,// 禁用全局Ajax事件. // ... });
下面是jQuery官方给出的完整的Ajax事件列表:
具体的全局事件请参考API文档。
好了,下面开始说jQuery里面功能最强的Ajax请求方法 $.ajax();
jQuery.ajax( options ) : 通过 HTTP 请求加载远程数据
这个是jQuery 的底层 AJAX 实现。简单易用的高层实现见 $.get, $.post 等。
$.ajax() 返回其创建的 XMLHttpRequest 对象。大多数情况下你无需直接操作该对象,但特殊情况下可用于手动终止请求。
注意: 如果你指定了 dataType 选项,请确保服务器返回正确的 MIME 信息,(如 xml 返回 "text/xml")。错误的 MIME 类型可能导致不可预知的错误。见 Specifying the Data Type for AJAX Requests 。
当设置 datatype 类型为 'script' 的时候,所有的远程(不在同一个域中)POST请求都回转换为GET方式。
$.ajax() 只有一个参数:参数 key/value 对象,包含各配置及回调函数信息。详细参数选项见下。
jQuery 1.2 中,您可以跨域加载 JSON 数据,使用时需将数据类型设置为 JSONP。使用 JSONP 形式调用函数时,如 "myurl?callback=?" jQuery 将自动替换 ? 为正确的函数名,以执行回调函数。数据类型设置为 "jsonp" 时,jQuery 将自动调用回调函数。(这个我不是很懂)
参数列表:
2013-07-02 18:34:25
有两个文件,运行一下,你就知道效果了
网上转过来的资料,是理解ajax() 函数 post及get方式的很好的例子。
点第一个按钮,是不是一个局部刷新的好例子啊。 如果把数据处理放在ajax_json.php里,那还可以改成一个小小微博吧
index.php
<html>
<head>
<title>jQuery Ajax 实例演示</title>
</head>
<meta. http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script. language="javascript" src="js/jquery.js"></script>
<script. language="javascript">
$(document).ready(function ()
{
$('#send_ajax').click(function (){
var params=$('input').serialize(); //序列化表单的值
alert(params);
$.ajax({
url:'ajax_json.php', //后台处理程序
type:'post', //数据发送方式
dataType:'json', //接受数据格式
data:params, //要传递的数据
success:update_page //回传函数(这里是函数名) //通过对json回传值的处理来做显示处理
});
});
//$.post()方式:
$('#test_post').click(function (){
$.post(
'ajax_json.php',
{
username:$('#input1').val(),
age:$('#input2').val(),
sex:$('#input3').val(),
job:$('#input4').val()
},
function (data) //回传函数
{
var myjson='';
eval('myjson=' + data + ';');
$('#result').html("姓名:" + myjson.username + "<br/>工作:" + myjson['job']);
}
);
});
//$.get()方式:
$('#test_get').click(function ()
{
$.get(
'ajax_json.php',
{
username:$("#input1").val(),
age:$("#input2").val(),
sex:$("#input3").val(),
job:$("#input4").val()
},
function(data) //回传函数
{
var myjson='';
eval("myjson=" + data + ";");
$('#result').html("姓名:" + myjson.username + "<br/>工作:" + myjson['job']);
}
);
});
});
function update_page (json) //回传函数实体,参数为XMLhttpRequest.responseText
{
var str="姓名:"+json.username+" ";
str+="年龄:"+json.age+" ";
str+="性别:"+json.sex+" ";
str+="工作:"+json.job+"<br/>";
//$("#result").html(str);
alert($("#result").append("<br/>新消息:<font color=green>"+str+"</font><br/>"));
}
</script>
<body>
<div id="result" style="background:orange;border:1px solid red;width:400px;height:200px;"></div>
<form. id="formtest" action="" method="post">
<p><span>输入姓名:</span><input type="text" name="username" id="input1" /></p>
<p><span>输入年龄:</span><input type="text" name="age" id="input2" /></p>
<p><span>输入性别:</span><input type="text" name="sex" id="input3" /></p>
<p><span>输入工作:</span><input type="text" name="job" id="input4" /></p>
</form>
<button id="send_ajax">提交</button>
<button id="test_post">POST提交</button>
<button id="test_get">GET提交</button>
<button id="ajax_post">GET提交</button>
</body>
</html>
ajax_json.php
<?php
//$arr = $_POST; //若以$.get()方式发送数据,则要改成$_GET.或者干脆:$_REQUEST
$arr = $_REQUEST;
//$arr['append'] = '测试字符串';
//print_r($arr);
if(function_exists("json_encode"))
echo json_encode($arr);
else
echo $arr;
?>
2012-07-06 15:48:39
做测试做了8年,前两年做的是与硬件产品相关的测试,质量管理比软件行业要严格的多的多,原因是,大部分的应用软件代码出错,改下代码重新编译,打补丁,就ok了,而一旦硬件设计出错,或者零件用错,造成的成本损失会很大,严重的可能是电路板报废,更严重的是导致整批产品的报废。当然,软件出错也能造成无可挽回的损失,只是某些特定领域会要求很严格,知识相对于硬件来说,程序修改要比电路板的维修成本相对低一些。
因为这种现象的存在,所以很多国内企业,尤其是一些小型的企业,对测试重视程度不够,甚至没有专门的测试人员,可能有的是为了项目需要,设立了测试团队,1人测试团队也屡见不鲜,我就知道好多企业是一人测试组,而且还是应届生的也有。对于这样的企业,您无法想象测试人员的地位会是什么样,老板都觉得设置测试人员是组织架构需要,而不是为了质量需要,那开发人员对测试人员自然也是不太看得起。
由于专职测试人员并不参与产品的代码编写,所以给人一种非生产劳动力的感觉,而且大多企业都是用一些编码能力较弱的人去做测试。
在很多外企中,对测试相对国内会重视一些,对测试人员素质要求也较高,对测试人员培训也较重视,但是并不代表测试人员地位就高,一样是会有开发人员看不起测试的情况,这种看不起并不会流于表面,而是骨子里的,没人说出来,但是会存在,大家心知肚明。
然而我们有时候也会听到有开发人员说某某测试人员挺厉害的,那么怎么样才能做一名让开发人员佩服的测试人员呢?
一,编程语言
你至少要掌握一门语言,不管是简单的php,java,还是C++也好,或者其他的脚本语言python,perl还是shell也好,至少你用一种语言真正的做过一些事情,而且能拿来就用。
二,数据库
你至少要掌握一种数据库的DBA,对SQL的操作要熟悉,至少能熟练的运用JOIN进行查询,知道基本的HAVING的用法,如果你能写存储过程,并且能优化存储过程那当然更好了,测试人员离不开数据库的管理和数据库的操作。
三,操作系统
作为测试人员,各种操作系统你应该很熟悉,系统安装,配置,管理,一个都不能少,对于Linux,你至少要对一种系统做过系统管理,熟悉常用的命令行操作,具体要会哪些,建议google一下,用Linux的时候,尽量能用命令行,就不要去点鼠标,因为它不是windows,要改变这样的习惯。能在Linux下能安装和配置软件,最好建议大家自己下载source code,亲自编译,了解make file的原理。
四,扎实的软件测试理论
这是做为测试人员最基本的,不要连开发人员都知道的一些测试方法,我们测试人员竟然没听过,很多测试人员觉得理论知识我看过,以为自己就了解了,其实做过一段时间之后,你再回头去看理论,会有更多的收获,我工作多年之后再看测试方面的书籍,发现还是会有不同的收获,理论是实践经验的总结,不能说最好,但是如果说你设计测试用例的时候,如果每种方法都有涉及到,你肯定会发现用例覆盖率会高,而且容易发现bug。
五,尽量自己分析问题
发现问题了,怎么办?可以找相关的开发人员帮忙分析,但是我想说的是,在发现问题之后,能自己尽量的寻找线索,首先要确定非环境因素,比如检查配置是否全部正确,网络是否有问题等等,然后确定非环境因素后,保护现场,保存记录系统提示信息,如果有日志功能,那自己先根据日志查找一些线索,并把自己检查过的地方和做过的分析信息尽可能多的提供给开发人员,而不是仅仅把错误日志或者错误信息丢给开发人员让他们分析就不管了。
六,多涉猎一些项目之外的知识
不要做一个项目,就两耳不闻窗外事,做测试的就是要涉猎的广,跟开发不同,测试是要能接受任何类型的项目,因为测试是一门方法学,方法学是不受某个产品或者领域限制的,但是如果你对其他领域也了解的多,对你做测试是有帮助的,前沿技术你也要了解一些。
七,掌握一些安全方面的知识
往往系统安全是很重要的,如果你能提出一些系统安全方面的漏洞,那别人自然会觉得你考虑的比较全面,至于安全方面需要哪些知识,我觉得首先从网络安全入手,了解一些密码学方面的知识,比如了解常用的加密算法原理,比如报文加密传输协议原理,建议看一下hash的方法,这个简单容易理解,还比较容易举一反三。
八,提高沟通能力,懂得尊重开发人员
测试人员要面对的人员很多,客户,项目经理,开发人员,产品经理等,有时候你会全部都接触的到,那么沉默就不一定是金,有良好正确的沟通能力,会帮助你提高在其他人心目中的好印象,沟通不是能说就行,要正确的沟通,高效的沟通,就是能用最简洁的语言把事情描述清楚,沟通的好,你的人缘就会好,就自然会受到大家的欢迎,其他人也愿意与你合作,千万不要在背后评论开发人员,即使评论,也评论别人的优点有哪些值得我们学习,懂得尊重开发人员,即使是你技术比别人强,懂得尊重别人的人才能被别人尊重。
九,不要自己把自己的地位降低
很多测试人员觉得自己做的测试工作本身就没有技术含量,觉得自己的工作创造的价值少,没有挑战性,其实如果连你自己都看不起自己,那如何让别人看得起你呢?
总之,做测试,是一门技术,也是一门艺术,我们把世界分为三个层次:技术(Technology),科学(Science),艺术(Art),技术是底层的,科学高一层,艺术是最高层的,技术可以通过短时间内学会,而如果把技术上升为科学,是需要大量的研究和积累的,而艺术的层次,这个不是学的来的,你需要有天赋,比如乔布斯,他就是因为有了艺术的天赋才造就了成功的苹果。
看着上面这些,你会不会觉得做测试要比开发需要学习的东西更多呢?如果你这么想,那就是正确的,真正优秀的测试人员,绝对是要在综合能力方面超过开发人员的,因为,你懂得的不仅仅是一门技术,你已经掌握了一门艺术。
杨柳@ 广州
杨柳博客网原文链接:http://www.yangliu.cc/?p=311
2010-04-27 16:40:41
2010-04-18 17:19:24
2009-12-28 17:03:19
2009-12-28 16:59:17
CSS跟JavaScript开发中,最令大家头疼的问题就是浏览器兼容性了,虽然很多文章有这方面的文章,但依然让很多开发人员晕头转向,而且也不够全面。这篇文章,将全面收集css和javascript在各种浏览器下的兼容性报告,也期待各位不断补充。
由于发觉内容收集越来越多,决定将CSS跟JavaScript分开。
一、document.formName.item(”itemName”) 问题
问题说明:IE下,可以使用 document.formName.item(”itemName”) 或
document.formName.elements ["elementName"];Firefox
下,只能使用document.formName.elements["elementName"]。
解决方法:统一使用document.formName.elements["elementName"]。
二、集合类对象问题
问题说明:IE下,可以使用 () 或 [] 获取集合类对象;Firefox下,只能使用 [ ]获取集合类对象。
解决方法:统一使用 [] 获取集合类对象。
三、自定义属性问题
问题说明:IE下,可以使用获取常规属性的方法来获取自定义属性,也可以使用 getAttribute() 获取自定义属性;Firefox下,只能使用 getAttribute() 获取自定义属性。
解决方法:统一通过 getAttribute() 获取自定义属性。
四、eval(”idName”)问题
问题说明:IE下,可以使用 eval(”idName”) 或 getElementById(”idName”) 来取得 id 为
idName 的HTML对象;Firefox下,只能使用 getElementById(”idName”) 来取得 id 为 idName
的HTML对象。
解决方法:统一用 getElementById(”idName”) 来取得 id 为 idName 的HTML对象。
五、变量名与某HTML对象ID相同的问题
问题说明:IE下,HTML对象的ID可以作为 document 的下属对象变量名直接使用,Firefox下则不能;Firefox下,可以使用与HTML对象ID相同的变量名,IE下则不能。
解决方法:使用 document.getElementById(”idName”) 代替 document.idName。最好不要取HTML对象ID相同的变量名,以减少错误;在声明变量时,一律加上var关键字,以避免歧义。
六、const问题
问题说明:Firefox下,可以使用const关键字或var关键字来定义常量;IE下,只能使用var关键字来定义常量。
解决方法:统一使用var关键字来定义常量。
七、input.type属性问题
问题说明:IE下 input.type 属性为只读;但是Firefox下 input.type 属性为读写。
解决办法:不修改 input.type 属性。如果必须要修改,可以先隐藏原来的input,然后在同样的位置再插入一个新的input元素。
八、window.event问题
问题说明:window.event 只能在IE下运行,而不能在Firefox下运行,这是因为Firefox的event只能在事件发生的现场使用。
解决方法:在事件发生的函数上加上event参数,在函数体内(假设形参为evt)使用 var myEvent = evt?evt:(window.event?window.event:null)
示例:
<input type="button" onclick="doSomething(event)"/>
<script language="javascript">
function doSomething(evt) {
var myEvent = evt?evt:(window.event?window.event:null)
...
}
九、event.x与event.y问题
问题说明:IE下,even对象有x、y属性,但是没有pageX、pageY属性;Firefox下,even对象有pageX、pageY属性,但是没有x、y属性。
解决方法:var myX = event.x ? event.x : event.pageX; var myY = event.y ? event.y:event.pageY;
如果考虑第8条问题,就改用myEvent代替event即可。
十、event.srcElement问题
问题说明:IE下,even对象有srcElement属性,但是没有target属性;Firefox下,even对象有target属性,但是没有srcElement属性。
解决方法:使用srcObj = event.srcElement ? event.srcElement : event.target;
如果考虑第8条问题,就改用myEvent代替event即可。
十一、window.location.href问题
问题说明:IE或者Firefox2.0.x下,可以使用window.location或window.location.href;Firefox1.5.x下,只能使用window.location。
解决方法:使用 window.location 来代替 window.location.href。当然也可以考虑使用 location.replace()方法。
十二、模态和非模态窗口问题
问题说明:IE下,可以通过showModalDialog和showModelessDialog打开模态和非模态窗口;Firefox下则不能。
解决方法:直接使用 window.open(pageURL,name,parameters) 方式打开新窗口。
如果需要将子窗口中的参数传递回父窗口,可以在子窗口中使用window.opener来访问父窗口。如果需要父窗口控制子窗口的话,使用 var
subWindow = window.open(pageURL,name,parameters); 来获得新开的窗口对象。
十三、frame和iframe问题
以下面的frame为例:
(1)访问frame对象
IE:使用window.frameId或者window.frameName来访问这个frame对象;
Firefox:使用window.frameName来访问这个frame对象;
解决方法:统一使用 window.document.getElementById(”frameId”) 来访问这个frame对象;
(2)切换frame内容
在IE和Firefox中都可以使用 window.document.getElementById(”frameId”).src =
“webjx.com.html”或 window.frameName.location =
“webjx.com.html”来切换frame的内容;
如果需要将frame中的参数传回父窗口,可以在frame中使用parent关键字来访问父窗口。
十四、body载入问题
问题说明:Firefox的body对象在body标签没有被浏览器完全读入之前就存在;而IE的body对象则必须在body标签被浏览器完全读入之后才存在。
[注] 这个问题尚未实际验证,待验证后再来修改。
[注] 经验证,IE6、Opera9以及FireFox2中不存在上述问题,单纯的JS脚本可以访问在脚本之前已经载入的所有对象和元素,即使这个元素还没有载入完成。
十五、事件委托方法
问题说明:IE下,使用 document.body.onload = inject; 其中function inject()在这之前已被实现;在Firefox下,使用 document.body.onload = inject();
解决方法:统一使用 document.body.onload=new Function(’inject()’); 或者 document.body.onload = function(){/* 这里是代码 */}
[注意] Function和function的区别
十六、访问的父元素的区别
问题说明:在IE下,使用 obj.parentElement 或 obj.parentNode 访问obj的父结点;在firefox下,使用 obj.parentNode 访问obj的父结点。
解决方法:因为firefox与IE都支持DOM,因此统一使用obj.parentNode 来访问obj的父结点。
十七、innerText的问题.
问题说明:innerText在IE中能正常工作,但是innerText在FireFox中却不行。
解决方法:在非IE浏览器中使用textContent代替innerText。
示例:
if(navigator.appName.indexOf("Explorer") >-1){
document.getElementById('element').innerText = "my text";
} else{
document.getElementById('element').textContent = ";my text";
}
[注] innerHTML 同时被ie、firefox等浏览器支持,其他的,如outerHTML等只被ie支持,最好不用。
十八、Table操作问题
问题说明:ie、firefox以及其它浏览器对于 table
标签的操作都各不相同,在ie中不允许对table和tr的innerHTML赋值,使用js增加一个tr时,使用appendChild方法也不管用。
document.appendChild在往表里插入行时FIREFOX支持,IE不支持
解决办法:把行插入到TBODY中,不要直接插入到表
解决方法:
//向table追加一个空行:
var row = otable.insertRow(-1);
var cell = document.createElement("td");
cell.innerHTML = "";
cell.className = "XXXX";
row.appendChild(cell);
[注] 建议使用JS框架集来操作table,如JQuery。
十九、对象宽高赋值问题
问题说明:FireFox中类似 obj.style.height = imgObj.height 的语句无效。
解决方法:统一使用 obj.style.height = imgObj.height + ‘px’;
二十、setAttribute(’style’,'color:red;’)
FIREFOX支持(除了IE,现在所有浏览器都支持),IE不支持
解决办法:不用setAttribute(’style’,'color:red’)
而用object.style.cssText = ‘color:red;’(这写法也有例外)
最好的办法是上面种方法都用上,万无一失
二一、类名设置
setAttribute(’class’,’styleClass’)
FIREFOX支持,IE不支持(指定属性名为class,IE不会设置元素的class属性,相反只使用setAttribute时IE自动识CLASSNAME属性)
解决办法:
setAttribute(’class’,’styleClass’)
setAttribute(’className’,’styleClass’)
或者直接 object.className=’styleClass’;
IE和FF都支持object.className。
二二、用setAttribute设置事件
var bj = document.getElementById(’objId’);
obj.setAttribute(’onclick’,'funcitonname();’);
FIREFOX支持,IE不支持
解决办法:
IE中必须用点记法来引用所需的事件处理程序,并且要用赋予匿名函数
如下:
var bj = document.getElementById(’objId’);
obj.onclick=function(){fucntionname();};
这种方法所有浏览器都支持
二三、建立单选钮
IE以外的浏览器
var rdo = document.createElement(’input’);
rdo.setAttribute(’type’,'radio’);
rdo.setAttribute(’name’,'radiobtn’);
rdo.setAttribute(’value’,'checked’);
IE:
var rdo =document.createElement(”<input name=”radiobtn” type=”radio” value=”checked” />”);
解决办法:
这一点区别和前面的都不一样。这次完全不同,所以找不到共同的办法来解决,那么只有IF-ELSE了
万幸的是,IE可以识别出document的uniqueID属性,别的浏览器都不可以识别出这一属性。问题解决。
2009-12-28 16:57:32
CSS跟JavaScript开发中,最令大家头疼的问题就是浏览器兼容性了,虽然很多文章有这方面的文章,但依然让很多开发人员晕头转向,而且也不够全面。这篇文章,将全面收集css在各种浏览器下的兼容性报告,以及浏览器的渲染bug,也期待各位不断补充。
1、DOCTYPE 影响 CSS 处理
2、FF: 设置 padding 后, div 会增加 height 和 width, 但 IE 不会, 故需要用 !important 多设一个 height 和 width
3、FF: 支持 !important, IE 则忽略, 可用 !important 为 FF 特别设置样式
4、div 的垂直居中问题: vertical-align:middle; 将行距增加到和整个DIV一样高 line-height:200px; 然后插入文字,就垂直居中了。缺点是要控制内容不要换行
5、在mozilla firefox和IE中的BOX模型解释不一致导致相差2px解决方法:
div{margin:30px!important;margin:28px;}
注意这两个margin的顺序一定不能写反,!important这个属性IE不能识别,但别的浏览器可以识别。所以在IE下其实解释成这样:
div{maring:30px;margin:28px}
重复定义的话按照最后一个来执行,所以不可以只写margin:XXpx!important;
1、ul和ol列表缩进问题
消除ul、ol等列表的缩进时,样式应写成:list-style.:none;margin:0px;padding:0px;
其中margin属性对IE有效,padding属性对FireFox有效。
[注]经验证,在IE中,设置margin:0px可以去除列表的上下左右缩进、空白以及列表编号或圆点,设置padding对样式没有影响;在 Firefox 中,设置margin:0px仅仅可以去除上下的空白,设置padding:0px后仅仅可以去掉左右缩进,还必须设置list- style.:none才 能去除列表编号或圆点。也就是说,在IE中仅仅设置margin:0px即可达到最终效果,而在Firefox中必须同时设置margin:0px、 padding:0px以及list-style.:none三项才能达到最终效果。
2、CSS透明问题
IE:filter:progid:DXImageTransform.Microsoft.Alpha(style=0,opacity=60)。
FF:opacity:0.6。
[注] 最好两个都写,并将opacity属性放在下面。
3、CSS圆角问题
IE:ie7以下版本不支持圆角。
FF: -moz-border-radius:4px,或者-moz-border-radius-topleft:4px;-moz-
border- radius-topright:4px;-moz-border-radius-bottomleft:4px;-moz-
border- radius- bottomright:4px;。
[注] 圆角问题是CSS中的经典问题,建议使用JQuery框架集来设置圆角,让这些复杂的问题留给别人去想吧。不过jQuery的圆角只看到支持整个区域的圆角,没有支持边框的圆角,不过这个边框的圆角可以通过一些简单的手段来实现,下次有机会介绍下。
4、cursor:hand VS cursor:pointer
问题说明:firefox不支持hand,但ie支持pointer ,两者都是手形指示。
解决方法:统一使用pointer。
5、字体大小定义不同
对字体大小small的定义不同,Firefox中为13px,而IE中为16px,差别挺大。
解决方法:使用指定的字体大小如14px。
并列排列的多个元素(图片或者链接)的div和div之间,代码中的空格和回车在firefox中都会被忽略,而IE中却默认显示为空格(约3px)。
6、CSS双线凹凸边框
IE:border:2px outset;。
FF: -moz-border-top-colors: #d4d0c8 white;-moz-border-left-colors:
#d4d0c8 white;-moz-border-right-colors:#404040
#808080;-moz-border-bottom-colors:#404040 #808080;
1、IE的双边距bug
设置为float的div在ie下设置的margin会加倍。这是一个ie6都存在的bug。
解决方案:在这个div里面加上display:inline;
例如:
<#div id=”imfloat”>
相应的css为
以下为引用的内容:
#IamFloat{
float:left;
margin:5px;/*IE下理解为10px*/
display:inline;/*IE下再理解为5px*/
}
关于CSS中的问题实在太多了,甚至同样的CSS定义在不同的页面标准中的显示效果都是不一样的。一个合乎发展的建议是,页面采用标准XHTML标 准编写,较少使用table,CSS定义尽量依照标准DOM,同时兼顾IE、Firefox、Opera等主流浏览器。很多情况下,FF和 Opera的CSS解释标准更贴近CSS标准,也更具有规范性。
2、IE选择符空格BUG
转载自:http://www.lisijie.org/article/105/
今天在给博客的段落样式设置首字符样式的时候发现,原来一个空格也可以使样式失效。
请看以下代码:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "//www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="//www.w3.org/1999/xhtml">
<head>
<title></title>
<style. type="text/css">
<!--
p{font-size:12px;}
p:first-letter{font-size:300%}
-->
</style>
</head>
<body>
<p>对于世界而言,你是一个人;但是对于某个人,你是他的整个世界。纵然伤心,也不要愁眉不展,因为你不知是谁会爱上你的笑容。</p>
</body>
</html>
这段代码对<p>的首字符样式定义在IE6上看是没有效果的(IE7没测试),而在p:first-letter和{font- size:300%}加上空格,也就是p:first-letter {font-size:300%}后,显示就正常了。但是同样的代码,在FireFox下看是正常的。按道理说,p:first- letter{font-size:300%}的写法是没错的。那么问题出在哪里呢?答案是伪类中的连字符”-”。IE有个BUG,在处理伪类时,如果伪类的名称中带有连字符”-”,伪类名称后面就得跟一个空格,不然样式的定义就无效。而在FF中,加不加空格都可以正常处理。
2009-11-20 14:00:12
QA Status Weekly-Report
Team |
auto testing team |
Prepared By |
|
Report Period |
March 12 – March 16 |
Status |
Red |
q Green – on schedule with no major issues q Yellow – not on schedule or there are significant issues which manager can handle q Red – not on schedule or missing major milestones. Need steering assistance |
Summary
Project status:
1. Planning HRMS
2. Evaluating TME auto testing framework
Major Work:
1. Planning HRMS
2. Evaluating TME auto testing framework
Issue:
1. TestLink can not satisfy customer’s requirements
Current Workload
Names |
Project |
Workload |
Percentage |
Riddick.Liu |
HRMS |
Read HRMS test case, Make schedule |
N/A |
TME auto testing framework |
Evaluate TME auto testing framework and Research Testlink |
N/A | |
|
|
N/A |
Next Week Plan
Names |
Project |
Items |
Percentage |
Days |
Riddick.Liu |
|
|
|
|
|
|
|
| |
|
|
|
|
2009-11-20 13:53:18
2008-06-18 12:03:48
This article needs additional citations for verification. Please help improve this article by adding reliable references. Unsourced material may be challenged and removed. (April 2008) |
In the field of software engineering, the Unified/Universal Modeling Language (UML) is a standardized visual specification language for object modeling. UML is a general-purpose modeling language that includes a graphical notation used to create an abstract model of a system, referred to as a UML model.
Contents[hide] |
UML is officially defined at the Object Management Group (OMG) by the UML metamodel, a Meta-Object Facility metamodel (MOF). Like other MOF-based specifications, UML has allowed software developers to concentrate more on design and architecture[citation needed].
UML models may be automatically transformed to other representations (e.g. Java) by means of QVT-like transformation languages, supported by the OMG.
UML is extensible, offering the following mechanisms for customization: profiles and stereotype. The semantics of extension by profiles have been improved with the UML 2.0 major revision.
After Rational Software Corporation hired James Rumbaugh from General Electric in 1994, the company became the source for the two most popular object-oriented modeling approaches of the day: Rumbaugh's OMT, which was better for object-oriented analysis (OOA), and Grady Booch's Booch method, which was better for object-oriented design (OOD). Together Rumbaugh and Booch attempted to reconcile their two approaches and started work on a Unified Method.
They were soon assisted in their efforts by Ivar Jacobson, the creator of the OOSE method. Jacobson joined Rational in 1995, after his company, Objectory, was acquired by Rational. The three methodologists were collectively referred to as the Three Amigos, since they were well known to argue frequently with each other regarding methodological preferences.
In 1996 Rational concluded that the abundance of modeling languages was slowing the adoption of object technology, so repositioning the work on a Unified Method, they tasked the Three Amigos with the development of a non-proprietary Unified Modeling Language. Representatives of competing Object Technology companies were consulted during OOPSLA '96, and were won over by Rumbaugh's a cappella rendition of his version of Joni Mitchell's "Clouds"[citation needed], indicating the victory of his OMT notation of using boxes for representing classes over Grady Booch's Booch method's notation that used cloud symbols.
Under the technical leadership of the Three Amigos, an international consortium called the UML Partners was organized in 1996 to complete the Unified Modeling Language (UML) specification, and propose it as a response to the OMG RFP. The UML Partners' UML 1.0 specification draft was proposed to the OMG in January 1997. During the same month the UML Partners formed a Semantics Task Force, chaired by Cris Kobryn and administered by Ed Eykholt, to finalize the semantics of the specification and integrate it with other standardization efforts. The result of this work, UML 1.1, was submitted to the OMG in August 1997 and adopted by the OMG in November 1997[1].
As a modeling notation, the influence of the OMT notation dominates (e. g., using rectangles for classes and objects). Though the Booch "cloud" notation was dropped, the Booch capability to specify lower-level design detail was embraced. The use case notation from Objectory and the component notation from Booch were integrated with the rest of the notation, but the semantic integration was relatively weak in UML 1.1, and was not really fixed until the UML 2.0 major revision.
Concepts from many other OO methods were also loosely integrated with UML with the intent that UML would support all OO methods. For example CRC Cards (circa 1989 from Kent Beck and Ward Cunningham), and OORam were retained. Many others contributed too with their approaches flavoring the many models of the day including: Tony Wasserman and Peter Pircher with the "Object-Oriented Structured Design (OOSD)" notation (not a method), Ray Buhr's "Systems Design with Ada", Archie Bowen's use case and timing analysis, Paul Ward's data analysis and David Harel's "Statecharts", as the group tried to ensure broad coverage in the real-time systems domain. As a result, UML is useful in a variety of engineering problems, from single process, single user applications to concurrent, distributed systems, making UML rich but large.
The Unified Modeling Language is an international standard:
UML has matured significantly since UML 1.1. Several minor revisions (UML 1.3, 1.4, and 1.5) fixed shortcomings and bugs with the first version of UML, followed by the UML 2.0 major revision that was adopted by the OMG in 2003. There are four parts to the UML 2.x specification: the Superstructure that defines the notation and semantics for diagrams and their model elements; the Infrastructure that defines the core metamodel on which the Superstructure is based; the Object Constraint Language (OCL) for defining rules for model elements; and the UML Diagram Interchange that defines how UML 2 diagram layouts are exchanged. The current versions of these standards follow: UML Superstructure version 2.1.2, UML Infrastructure version 2.1.2, OCL version 2.0, and UML Diagram Interchange version 1.0[2].
Although many UML tools support some of the new features of UML 2.x, the OMG provides no test suite to objectively test compliance with its specifications.
UML is not a method by itself; however, it was designed to be compatible with the leading object-oriented software development methods of its time (for example OMT, Booch, Objectory). Since UML has evolved, some of these methods have been recast to take advantage of the new notation (for example OMT), and new methods have been created based on UML. The best known is Rational Unified Process (RUP). There are many other UML-based methods like Abstraction Method, Dynamic Systems Development Method, and others, designed to provide more specific solutions, or achieve different objectives.
It is very important to distinguish between the UML model and the set of diagrams of a system. A diagram is a partial graphical representation of a system's model. The model also contains a "semantic backplane" — documentation such as written use cases that drive the model elements and diagrams.
UML diagrams represent three different views of a system model:
Functional requirements view
Static structural view
Dynamic behavīor view
UML models can be exchanged among UML tools by using the XMI interchange format.
UML 2.0 has 13 types of diagrams that can be categorized hierarchically as shown in the following Class diagram:
Structure diagrams emphasize what things must be in the system being modeled:
behavīor diagrams emphasize what must happen in the system being modeled:
Interaction diagrams, a subset of behavīor diagrams, emphasize the flow of control and data among the things in the system being modeled:
The Protocol State Machine is a sub-variant of the State Machine. It may be used to model network communication protocols.
UML does not restrict UML element types to a certain diagram type. In general, every UML element may appear on almost all types of diagrams. This flexibility has been partially restricted in UML 2.0.
In keeping with the tradition of engineering drawings, a comment or note explaining usage, constraint, or intent is always allowed in a UML diagram.
UML uses many concepts from many sources. For a definitive list, consult the glossary of Unified Modeling Language terms. Notable concepts are listed here.
For structure
For behavīor
For relationships
Other concepts
Although UML is a widely recognized and used modeling standard, it is frequently criticized for the following deficiencies:
Many modeling experts have written sharp criticisms of UML, including Bertrand Meyer's "UML: The Positive Spin"[3], and a paper presented by Brian Henderson-Sellers at the MoDELS/UML conference in Genova, Italy in October 2006[citation needed].
2008-06-18 11:59:59
2008-05-23 13:00:31
首先说说要做个软件测试工程师,需要了解的方方面面,也可以说是一个职业要求汇总吧。
基本常识类
1. 计算机基础知识
2. 计算机网络基础知识
3. 软件测试基本知识(软件质量,软件质量管理基础知识,软件测试概念,软件测试标准,软件测试技术及方法,软件测试项目管理)
4. 软件开发基本知识(软件工程知识,理解软件开发方法及过程)
技术类
1. 程序语言
C/C++,VB,VC,Java,.net,ASP,javas cript等。具体要求要视公司的具体项目或产品来定。但一般以C为基本要求。
2. 数据库知识
SQL Server,Oracle,Mysql,Sybase等。一般对测试人员的要求就是要求会使用,然后熟练使用SQL语句进行查询,修改,添加,删除数据操作。
3. 操作系统
Windows,Linux(常用的RedHat,SUSE,Debian)/Unix(FreeBSD,Solaris,HP-UX,AIX,Mac)系统。
自动化测试工具类
1. 自动化测试概念/自动化测试框架
好多人觉得自动化测试就是使用自动化测试工具,其实各种工具只是自动化测试实施的一个有效利器,如何建立一个脱离工具的自动化测试框架远远比研究如何使用测试工具复杂,困难的多。
2. 自动化测试流程
3. 自动化测试工具的使用
自动化测试框架(流程)
GUI的功能测试自动化
非GUI的功能测试自动化
性能测试(广义的和狭义的性能测试)
自动化测试工具(功能测试工具,性能测试工具,缺陷管理工具,测试管理工具)
(HP)Mercury Interactive QuickTest Pro,WinRunner,LoadRunner,Quality Center(Test Director),SiteScope
Compuware QACenter(TestPartner QARun QALoad QADirector TrackRecord),DevPartner studio
(IBM)Rational TestSuite(Robot TestManager FunctionalTester PerformeranceTester ClearQuest ClearCase ...)
(Borland)Segue SilkTest SilkPerformer SCTestManager
其它:JUnit,NUnit,Auto It,Test Architect,OpenSTA等
实战类(工作经验)
1. 公司的测试流程
2. 公司的具体缺陷管理流程(提交bug报告,追踪bug状态)
3. 测试环境的搭建及管理
4. 测试计划,测试用例,测试报告等相关文档的编写
语言类
1. 英语
2. 日语
3. 。。。
性格类
通过30分钟至1个小时的面试,试着了解面试者的性格是否适合软件测试的工作。
1. 细心,关注细节
2. 耐心,不怕麻烦
3. 良好的沟通能力
4. 优秀的学习能力,逻辑思维强
5. 工作积极主动
6. 上进性强,永远不满足现状
2008-05-23 12:59:21
2008-05-23 10:39:09
1 A necessary part of a test case is a definition of the
expected output or result.
a test case must consist
of two components:
1. A descrīption of the input data to the program.
2. A precise descrīption of the correct output of the program
for that set of input data.
2 A programmer should avoid attempting to test his or her
own program.
3 A programming organization should not test its own
programs.
4 Thoroughly inspect the results of each test.
5 Test cases must be written for input conditions that are
invalid and unexpected, as well as for those that are valid
and expected.
6 Examining a program to see if it does not do what it is
supposed to do is only half the battle; the other half is
seeing whether the program does what it is not supposed
to do.
7 Avoid throwaway test cases unless the program is truly a
throwaway program.
8 Do not plan a testing effort under the tacit assumption
that no errors will be found.
9 The probability of the existence of more errors in a
section of a program is proportional to the number of
errors already found in that section.
10 Testing is an extremely creative and intellectually
challenging task.
2007-09-09 10:08:18
2007-05-15 16:36:53
2007-05-15 16:34:29
我在用fedora5时,想用这些程序的时候,在fedora 5 下,这些程序放在太多文件夹下,对一名对fedora 5不熟的人很是麻烦。所以决定把这些程序删了重装。
我之所以写这些文字,因为我在google 搜了太多不能实现的教程,希望这篇文章对初学者有点帮助。
主要软件包:
mysql-standard-5.0.27-linux-i686-glibc23.tar.gz
url:http://dev.mysql.com/downloads/mysql/5.0.html#downloads 下找个镜像
php-5.2.1.tar.gz
url:http://www.php.net/downloads.php
用第2个,第一个包好像少东西,我就是第一个不成功,所以才用第2个包,
这个包一定要选好,安装时候大部分问题都出在这个包
httpd-2.2.4.tar.gz
url:http://www.apache.org/dyn/closer.cgi 选个镜像
PS:源程序尽量到官方网站下,国内站点编辑好多不负责任,源程序少东西
安装php所需的软件包
(其中libxml2是安装php5必须的)
libxml2-2.6.26.tar.gz
libxslt-1.1.17.tar.gz
curl-7.16.1.tar.gz
以上安装包在安装FC5的时候都安装了 没有安装的 请下载后安装
GD库所需要软件包
(有人说PHP源码包里自带了GD2.0.28和zlib,
只要安装GD的三个支持包:jpg,png和freetype,但是我们还是下载)
gd-2.0.34.tar.gz
freetype-2.3.1.tar.gz
jpegsrc.v6b.tar.gz
libpng-1.2.16.tar.gz
zlib-1.2.3.tar.gz
PS:这些源程序只要你在www.google.com 里搜 名称+download(例如:libxml2-2.6.26.tar.gz ,就输入:libxml download,第1页就可以找到官方网站)
卸载:
我们需要把原来系统自带的或者后来采用rpm方式安装的Apache | mysql | php软件卸载掉,我听说不卸载rpm也是可以的,不会影响源码包或者二进制包的安装,就是将来你不起动那些进程就没问题了,但我还是建议卸载,因为 rpm方式安装的软件把各种文件放在很多奇怪的地方,我感觉是非常不好管理的。
下面的卸载范例是Fedora core2默认安装的包。
卸载Mysql
[root@yourdomainname/]# rpm -qa | grep mysql
mysql-3.23.58-9
php-mysql-4.3.4-11
mod_auth_mysql-20030510-4.1
mysql-server-3.23.58-9
说明:rpm –qa | grep mysql 命令是为了把mysql相关的包都列出来,我上面的例子是Fedora core2默认安装mysql的rpm软件包列表,如果是别的Linux版本列出来的列表有可能会不一样,不过不用担心,不管是什么,卸载都从最下面的一个包开始,直到卸载掉第一个为止。
比如:在这个例子中,我们应该先卸载mysql-server-3.23.58-9 方法如下:
rpm –e mysql-server
说明:rpm –e 是卸载rpm包的命令,后面是包名称,最后的版本号是不用打的,比如我们下一步卸载mod_auth_mysql-20030510-4.1包,方法如下:
rpm –e mod_auth_mysql
卸载Apache
[root@ yourdomainname /]# rpm -qa | grep httpd
httpd-2.0.49-4
system-config-httpd-1.2.0-3
httpd-manual-2.0.49-4
说明:方法跟卸载Mysql一样,不用说了吧
卸载PHP
[root@ yourdomainname /]# rpm -qa | grep php
php-odbc-4.3.4-11
php-4.3.4-11
php-mysql-4.3.4-11
php-pear-4.3.4-11
php-ldap-4.3.4-11
php-pgsql-4.3.4-11
说明:方法跟卸载Mysql一样,不用说了吧
⑶伊谐鲆览档陌拿疲刃对靥崾疽览档陌涂梢粤恕?
如果实在实在有卸载不掉的包,可以加—nodeps这个参数来卸载,比如我们卸载php-4.3.4-11,实在卸不掉了。就用:
[root@ yourdomainname /]# rpm -e php-4.3.4-11 –nodeps 命令很强硬,应该行的。卸载这段话是抄网上的,我在fedora5 上照葫芦划瓢,还可以,你不要担心会不会把不该删的删掉了,因为即使你删了不该删的,你用上时,可以到网上找相应模块,加到相应的位置就行了,linux下没有注册表这一说,不像windows
安装:
假定你压缩的源代码放在:/software 下
# mkdir -p /software
进入 /software目录
# cd /software
解压httpd-2.2.4.tar.gz
# tar -zvxf httpd-2.2.4.tar.gz
进入httpd-2.2.4目录
# cd httpd-2.2.4
配置APACHE安装文件
# ./configure --prefix=/usr/local/apache2 / (apache安装目录)
--with-mpm=worker /(这里我使用的多线程多进程的多路处理模块)
--enable-mods-shared=all / (使所有模块都编译成DSO)
--enable-rewrite /(rewrite模块)
--enable-proxy /(proxy模块)
--enable-proxy_http /(proxy_http模块)
--enable-ssl /(SSL模块)
--with-perl(支持PERL)
* 这里使用"/"是命令行转行 方便查看及修改
编译
#make;make install
一般安装APACHE不会有什么问题出现
2.安装MYSQL
# cd /software
# tar -zvxf mysql-standard-5.0.27-linux-i686-glibc23.tar.gz
# mv mysql-standard-5.0.27-linux-i686-glibc23 /usr/local/mysql
# cp /usr/local/mysql/support-files/my-medium.cnf /etc/my.cnf
#cd /usr/local/mysql
添加mysql用户及用户组
# groupadd mysql
# useradd -g mysql mysql
生成mysql系统数据库
# /usr/local/mysql/scrīpts/mysql_install_db --user=mysql&
修改mysql目录权限
# chown -R root /usr/local/mysql
# chgrp -R mysql /usr/local/mysql
# chown -R mysql /usr/local/mysql/data
启动mysql服务
# /usr/local/mysql/bin/mysqld_safe --user=mysql&
如果没出现错,代表正常启动mysql服务了, 按Ctrl + C 跳出
3.安装GD
a.安装 jpeg6
建立目录:
# mkdir -p /usr/local/module/jpeg6
# mkdir -p /usr/local/module/jpeg6/bin
# mkdir -p /usr/local/module/jpeg6/lib
# mkdir -p /usr/local/module/jpeg6/include
# mkdir -p /usr/local/module/jpeg6/man
# mkdir -p /usr/local/module/jpeg6/man1
# mkdir -p /usr/local/module/jpeg6/man/man1
# cd /software
# tar -zvxf jpegsrc.v6b.tar.gz
# cd jpeg-6b
# ./configure --prefix=/usr/local/module/jpeg6 --enable-shared --enable-static
# make; make install
* jpeg6安装文件中没有写创建目录的命令
b.安装libpng
安装步骤如下
# cd /software
# tar -zvxf libpng-1.2.16.tar.gz
# cd libpng-1.2.16
# cp scrīpts/makefile.std makefile
# make; make install
c.安装 freetype
# cd /software
# tar -zvxf freetype-2.3.1.tar.gz
# cd freetype-2.3.1
# ./configure --prefix=/usr/local/module/freetype
# make;make install
d.:安装zlib
这个一般不用安装
# cd /software
#tar -zxvf zlib-1.2.3.tar.gz
#cd zlib.1.2.3
# .
/configure
# make;make install
e.安装Curl库
这个一般不用安装
# cd /software
# tar -zvxf curl-7.16.1.tar.gz
# mkdir -p /usr/local/curl
# ./configure --prefix=/usr/local/curl
# make; make install
f.安装GD
# cd /software
# tar -zvxf gd-2.0.34.tar.gz
# mkdir -p /usr/local/module/gd
# cd gd-2.0.33
# ./configure --prefix=/usr/local/module/gd /
> --with-png /
> --with-jpeg-dir=/usr/local/module/jpeg6 /
> --with-freetype=/usr/local/module/freetype /
> --with-zlib
# make; make install
4.安装php5,php5必须有libxml2支持!编译通不过大部分是由于这个模块
a.安装libxml2
# cd /software # tar -zxf libxml2-2.6.26.tar.gz
# cd libxml2-2.6.26
# mkdir -p /usr/local/module/libxml2
# ./configure --prefix=/usr/local/module/libxml2
# make; make install
b.安装 libxslt(可选安装,你可以不安装)
# cd /software
# tar -zxf libxslt-1.1.15.tar.gz
# mkdir -p /usr/local/module/libxslt
# cd libxslt-1.1.17
# ./configure --prefix=/usr/local/module/libxslt --with-libxml-prefix=/usr/local/module/libxml2
# make; make install
c.安装php5
# cd /software
# tar -zvxf php-5.2.1.tar.gz
# mkdir -p /usr/local/php
# cd php-5.2.1
# ./configure --prefix=/usr/local/php /
--with-apxs2=/usr/local/apache2/bin/apxs /
--with-mysql=/usr/local/mysql /
--with-xml /
--with-png /
--with-jpeg-dir=/usr/local/module/jpeg6 /
--with-zlib /
--with-freetype-dir=/usr/local/module/freetype /
--with-gd=/usr/local/module/gd /
--with-curl /
--enable-track-vars /
--disable-debug /
--enable-url-includes /
--enable-sockets /
--enable-force-cgi-redirect /
--enable-calendar /
--with-config-file-path=/etc /
--enable-magic-quotes /
--enable-ftp /
--enable-gd-native-ttf /
--with-ttf /
--with-gdbm /
--with-gettext /
--with-iconv /
--enable-mbstring=all /
--enable-memory-limit /
--with-libxml-dir=/usr/local/module/libxml2 /
--with-xsl=/usr/local/module/libxslt /
--enable-xslt
# make
# make install
# cp php.ini-dist /usr/local/php/lib/php.ini (别忘记了呵呵)
如果通不过,运行下面2行
# cp php.ini-dist /usr/local/lib/php.ini
# cp php.ini-dist /etc/php.ini
其中./configure 后的
--prefix=/usr/local/php
--with-apxs2=/usr/local/apache2/bin/apxs
--with-mysql=/usr/local/mysql
--with-xml
是必要的选项
--with-png /
--with-jpeg-dir=/usr/local/module/jpeg6 /
--with-gd=/usr/local/modules/gd /
--with-zlib /
--with-freetype-dir=/usr/local/module/freetype /
这是让PHP支持GD库的配置选项
后面都是一些 要使用的PHP 函数库 可以根据自己的喜好 删除或增加
重新配置apache2让他支持php?
?
配置 httpd.conf 让apache支持PHP
# vi /usr/local/apache2/conf/httpd.conf
找到 AddType application/x-gzip .gz .tgz 在其下添加如下内容
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps
重启apache
# /usr/local/apache2/bin/apachectl restart
在
查看(908)
评论(0)
收藏
分享
管理
清空Cookie - 联系我们 - 51Testing软件测试网 - 交流论坛 - 空间列表 - 站点存档 - 升级自己的空间
Powered by 51Testing
© 2003-2021
沪ICP备05003035号