易截截图软件、单文件、免安装、纯绿色、仅160KB

javascript跨浏览器创建XML对象


var
 
xmlDoc
 
=
 
null
;
function
 
parseXML
(
xmlUrl
)
{
  try
 
{
    //IE
    xmlDoc
 
=
 
new
 
ActiveXObject
(
"Microsoft.XMLDOM"
);
    xmlDoc
.
async
 
=
 
false
;
    xmlDoc
.
load
(
xmlUrl
);
  }
catch
(
e
)
  {
    try
{
    //
Firefox

Mozilla

Opera

etc
.
    xmlDoc
 
=
 
document
.
implementation
.
createDocument
(
""
,
""
,
null
);
    xmlDoc
.
async
 
=
 
false
;
    xmlDoc
.
load
(
xmlUrl
);
    }
catch
(
e
)
    {
      try
{
        //
google
,
Safari
       
var
 
xmlhttp
 
=
 
new
 
window
.
XMLHttpRequest
();
        xmlhttp
.
open
(
"GET"
,
xmlUrl
,
false
);
        xmlhttp
.
send
(
null
);
        xmlDoc
 
=
 
xmlhttp
.
responseXML
.
documentElement
;
      }
catch
(
e
){
alert
(
e
.
message
+
"  EROR"
);
return
;}
    }
  }
}


相关文档:

[读书笔记][JavaScript高级程序设计]

第二章:ECMAScript基础
1.当函数无明确返回值时,返回的也是值undefined
  function testFunc(){}
  alert(testFunc()==undefined);
2.typeof(null)=='object' //true,null可以解释为对象占位符
3.undefined 是声明了变量但未对其初始化时赋予该变量的值,null则用于表示尚未存在的对象。
  alert(nu ......

[翻译]High Performance JavaScript(006)

Identifier Resolution Performance  标识符识别性能
    Identifier resolution isn't free, as in fact no computer operation really is without some sort of performance overhead. The deeper into the execution context's scope chain an identifier exists, the slower it is to access for ......

[翻译]High Performance JavaScript(008)

Nested Members  嵌套成员
    Since object members may contain other members, it's not uncommon to see patterns such as window.location.href in JavaScript code. These nested members cause the JavaScript engine to go through the object member resolution process each time a dot is ......

php数据库导出类 导出JSON,XML,WORD,EXCEL

from:http://www.xland.com.cn/article/7/81/0804/28778.htm
本类实现:
数据库信息导出:word,excel,json,xml,sql
数据库恢复:从sql,从文件
具体用法:
首先新建测试用数据库mytest,然后在里面建张表
PHP代码:
以下是代码片段:
--
-- 表的结构 `test`
--
CREATE TABLE `test` (
   `id ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号