淘宝商城(天猫)高级技术专家.3年研发+3年性能测试调优/系统测试+4年团队管理与测试架构、研发系统实践. 新舞台新气象, 深化测试基础架构及研发架构,希望能在某个技术领域成为真正的技术大牛。欢迎荐才http://bbs.51testing.com/viewthread.php?tid=120496&extra=&page=1 .邮件: jianzhao.liangjz@alibaba-inc.com,MSN:liangjianzhao@163.com.微博:http://t.sina.com.cn/1674816524

发布新日志

  • javascript 显示flash

    2008-05-05 20:58:58

    <html >
      <head>
          <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
         <scrīpt type="text/javascrīpt" language="javascrīpt">   
         function swf(url) {
                document.getElementById("flash_span").innerHTML='<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0"><param name="movie" value="' + url + '" /><embed width=0 height=0 src="' + url + '" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" /></object>'
            }       
        </scrīpt>     
       
     </head>
      <body>
       <span id="flash_span" style=""></span>
        <button name="click"  ōnclick="swf('http://10.0.6.91/uploadfiles/flashes/d55bcef8682a8f87fee992e08771be5c8d784e77.swf')">
    </body>

    </html>

     

     

  • 体验ajax 程序

    2008-05-02 13:12:28

     

    经过测试在IE6 以及firefox2.0 都可以正常运行的ajax程序

     

    <html xmlns="http://www.w3.org/1999/xhtml" >
    <head>
    <title>ajax demo</title>

    <scrīpt type="text/javascrīpt" language="javascrīpt">
     var httpRequest =false;
        function makeRequest(url) {       
     document.getElementById("result").innerHTML="";
            if (window.XMLHttpRequest) { // Mozilla, Safari, ...
                httpRequest = new XMLHttpRequest();
                if (httpRequest.overrideMimeType) {
                    httpRequest.overrideMimeType('text/xml');
                    // See note below about this line
                }
            }
            else if (window.ActiveXObject) { // IE
      var versions = ['Microsoft.XMLHTTP', 'MSXML2.XMLHTTP','MSXML.XMLHTTP', 'Msxml2.XMLHTTP.7.0',

    'Msxml2.XMLHTTP.6.0', 'Msxml2.XMLHTTP.5.0', 'Msxml2.XMLHTTP.4.0', 'MSXML2.XMLHTTP.3.0', ];
       for(var i=0; i<versions.length; i++) {
            try {
           httpRequest = new ActiveXObject(versions[i]);     
        } catch(e) {}
       }
             }
            if (!httpRequest) {
                alert('Cannot create an XMLHTTP instance');
                return false;
            }
     
            httpRequest.onreadystatechange = alertContents;   //function() { alertContents(httpRequest); };
            httpRequest.open('GET', url, true);
     httpRequest.setRequestHeader('Cache-Control','no-cache');
            httpRequest.send('');
        }

        function alertContents(){
            if (httpRequest.readyState == 4) {
                if (httpRequest.status == 200) {
                    //alert(httpRequest.responseText);
      document.getElementById("result").innerHTML =httpRequest.responseText;
                } else {
                   document.getElementById("result").innerHTML='There was a problem with the request.';
                }
            }
        }
    </scrīpt>
    </head>
    <body>
    <span
        style="cursor: pointer; text-decoration: underline"
        ōnclick="makeRequest('http://127.0.0.1:3000/my_test/')">
            Make a request
    </span>
    <br>
    <span id="result" style="" >
    </body>
    </html>

     

    在本地启动mongrel服务器侦听3000端口

  • web前端性能分析工具

    2008-05-02 01:36:20

      以前关注服务器端性能测试,现在投了一些精力在了解web前端性能测试。有几个很趁手的工具

    1)ibm page detailer。注册IBM 帐号后,下载了basic版本的。第一个感觉就是惊艳,能把网页duration(切分服务器时间、下载时间等,与loadrunner page break down类似),item等等.基本上满足我们目前需求.

      在启动page detailer后,再启动IE后的HTTP 请求都被截获。

    2) firefox插件firebug。呵呵,这个工具开源的,功能也很强大,而且javascrīpt调试能力好。呵呵,目前 ALIBABA的部分应用支持firefox不如ie好啊。

    3)yahoo yslow。也是firefox插件。偶还没有试用过:)

       前2个工具切实给页面调优带来较大的想象空间:) 

       看来好工具还是很多的,关键是要有发现的眼光:)

     

     

  • 前端技术-- ajax框架

    2008-05-02 00:00:04

        以前性能测试关注重心在服务器端,最近有几个应用提出客户端性能度量问题。呵呵,正在了解前端技术领域。

         前端技术包括Javascrīpt、Actionscrīpt、CSS、xHTML等传统技术与Adobe AIR、Google Gears等新技术。 淘宝网大规模应用ajax框架 。

       Ajax框架主要有如下几种 :

    Prototype http://prototypejs.org, http://scrīpt.aculo.us
    JQuery    http://jquery.com      
    Ext JS2.0-  javascrīpt library    http://www.extjs.com
    scrīpt.aculo.us
    Mootools
    YUI              http://developer.yahoo.com/yui,淘宝网采用YUI,现在自主研发Tbra(不是100%确信)
    JSON
    Dojo             http://dojotoolkit.org
    BackBase

      另外找到一个firefox上调试js的好插件:firebug

     

Open Toolbar