2008-06-30

String.prototype.split

关键字: string.prototype.split
/* 官网原文: ES3 states that “If separator is a regular expression that contains capturing parentheses, then each time separator is matched the results (including any undefined results) of the capturing parentheses are spliced into the output array.” JScript ignores the capturing parentheses. FF ...
2008-06-30

Array.prototype.unshift

关键字: array.prototype.unshift
/* 官网原文: Array.unshift prepends its arguments to the start of the array and is supposed to return the length of the resultant array. The returned value of this function call in JScript is “undefined”. */ // 将指定的元素插入数组开始位置并返回该数组。 var a = new Array(1, 2, 3); var l = a.unshift(); docum ...
2008-06-30

Array.prototype.join

关键字: array.prototype.join
/* JScript does not default the separator to “,” if the separator value is undefined. */ var array = [1, 2]; alert(array.join()); alert(array.join(undefined)); alert(array.join('-')); /* Output: IE: 1,2 1undefined2 1-2 FF: 1,2 1,2 1-2 Opera: same as FF Safari: same ...
2008-06-30

The try statement:

关键字: the try statement:
/* 官网原文: In JScript, the variable used to hold a caught exception is visible in the enclosing scope. The variable exists after the catch clause has finished executing but ceases to exist after the function where the catch clause was located exits. */ function foo() { try { ...
2008-06-30

Enumerating shadowed

关键字: enumerating shadowed
/* 官网原文: Custom properties that shadow [[DontEnum]] properties on Object.prototype are not enumerated using for-in. In the following example toString is a property available on Object.prototype and is shadowed on cowboy. Since such properties are not enumerated through for-in, it is not possible ...
2008-06-30

Function Declarations within bodies

关键字: function declarations within bodies
/* 官网原文: When a function is defined using a function declaration, JScript binds the function to the global scope regardless of any scope changes introduced by with clauses. */ var v = 'value 1'; var o = {v: 'value 2'}; function f1() { alert('v == ' + v); }; with (o) ...
2008-06-29

体会javascript

关键字: 体会javascript
没有类 object就是对象的类型。在JavaScript中不管多么复杂的数据和代码,都可以组织成object形式的对象。 但JavaScript却没有 “类”的概念! 对于许多面向对象的程序员来说,这恐怕是JavaScript中最难以理解的地方。是啊,几乎任何讲面向对象的书中,第一个要讲的就是“类”的概念,这可是面向对象的支柱。这突然没有了“类”,我们就象一下子没了精神支柱,感到六神无主。看来,要放下对象和类,达到“对象本无根,类型亦无形”的境界确实是件不容易的事情啊。 这样,我们先来看一段JavaScript程序: var life = ...
2008-06-29

java虚拟机参数2 (转贴)

关键字: java虚拟机参数2 (转贴)
JVM配置参数中文说明: ----------------------------------------------------------------------- 1、-Xmixed mixed mode execution (default) 混合模式执行 2、-Xint interpreted mode execution only 解释模式执行 3、-Xbootclasspath:<directories and zi ...
2008-06-29

tomcat server.xml 详解(转贴)

关键字: tomcat server.xml 详解(转贴)server
server port 指定一个端口,这个端口负责监听关闭tomcat的请求 shutdown 指定向端口发送的命令字符串 service name 指定service的名字 Connector(表示客户端和service之间的连接) port 指定服务器端要创建的端口号,并在这个端口监听来自客户端的请求 minProcessors 服务器启动时创建的处理请求的线程数 maxProcessors 最大可以创建的处理请求的线程数 enableLookups 如果为true,则可以通过调用request.getRemoteHost()进行DNS查询来得到 ...
2008-06-29

java script 刷新页面(转贴alert(平淡中搜询我的快乐)永久域名 http://al)

关键字: java script 刷新页面(转贴alert(平淡中搜询我的快乐)永久域名 http://al)
用iframe、弹出子页面刷新父页面iframe <script language=JavaScript> parent.location.reload(); </script>弹出子页面 <script language=JavaScript> window.opener.location.reload(); </script> 子窗口刷新父窗口 <script language=JavaScript> self.opener.location.reload(); </script> 刷新以open()方法 ...
2008-06-29

JavaScript日志框架(转贴)

关键字: javascript日志框架
log4javascript是一个基于log4j的JavaScript日志框架。 首页:http://www.timdown.co.uk/log4javascript/ 下载地址:http://sourceforge.net/projects/log4javascript 基本用法 : <html> <head> <title> </title> <script type="text/javascript" src="log4javascript.js"> </script> <script type="text/j ...
2008-06-29

java script 单元测试JSUnit 使用(转贴)

关键字: java script 单元测试jsunit 使用(转贴)jsunit 就是 junit 的javascript 版本,
Jsunit 就是 Junit 的javascript 版本,下载并解压Jsunit zip,大部分的核心文件都在 jsunit/app 目录下,两个最基本的文件: . jsUnitCore.js -- 每个测试文件都要引用它 . testRunner.html -- 用来运行具体的jsunit 测试 (1) 起步例子: 在Jsunit解压后的同级目录下建立两个文件,目录结构: |-- jsunit |-- simple.js |-- simple_test.html 写完后运行 jsunit/testRunner.html,在页面中选择simple_test.html, 点击run,可以 ...
  • 16:45
  • 浏览 (60)
  • 评论 (0)
2008-06-29

java script 读取xml (转贴)

关键字: java script 读取xml (转贴)
首先:xml文件(tree.xml)内容如下: <?xml version="1.0" encoding="gb2312"?> <treeview> <tree id="p1"> <text>山东省</text> <target>_blank</target> <title>省份</title> <link></link> <tree id="p1-1"> <text>威海市</text> <target>_blank</target> <title> ...
2008-06-29

转贴Eclipse 快捷键

关键字: 转贴eclipse 快捷键
Eclipse快捷键大全(转载) Ctrl+1 快速修复 Ctrl+D: 删除当前行 Ctrl+Alt+↓ 复制当前行到下一行(复制增加) Ctrl+Alt+↑ 复制当前行到上一行(复制增加) ? Alt+↓ 当前行和下面一行交互位置(特别实用,可以省去先剪切,再粘贴了) Alt+↑ 当前行和上面一行交互位置(同上) Alt+← 前一个编辑的页面 Alt+→ 下一个编辑的页面(当然是针对上面那条来说了) Alt+Enter 显示当前选择资源(工程,or 文件 or文件)的属性 Shift+Enter 在当前行的下一行插入空行(这时鼠标可以在当前行的任一位置,不一定是最后) Shift+C ...
2008-06-27

java虚拟机参数1 (转贴)

关键字: java虚拟机参数1 (转贴)
下面的讨论以Windows平台的Sun MicroSystem实现的java5虚拟机为蓝本,其他操作系统或其他公司实现的虚拟机参数会有部分不同,但大部分含义都和Windows上的类似。 Java5与以前版本相比,虚拟机参数大部分保持了向前兼容,同时也增加了一些新的参数,本文将对这些参数的作用作详细描述,使虚拟机能更符合运行环境的 需要,获得更好的性能和稳定性。 Java 在运行已编译完成的类时,是通过java虚拟机来装载和执行的,java虚拟机通过操作系统命令JAVA_HOME\bin\java –option 来启动,-option为虚拟机参数,JAVA_HOME为JDK安装路径,通过这些参 ...
2008-06-26

Function Expressions scope

关键字: function expressions scope
/* 官网原文: In JScript the identifier in a function expression is visible in the enclosing scope because such expressions are treated as function declarations. Example: */ <script> var foo = function bar(b) { if (b == true) { ...
2008-06-26

Array Initialiser 要小心

关键字: array initialiser 要小心
/* Trailing commas in array literals add to the length, but they shouldn‟t. JScript treats the empty element after the trailing comma as undefined. Example: */ <script> document.write([1, 2, 3,].length); </script> /* Output: IE: 4 ...
2008-06-26

全局函数不能被迭代

关键字: 全局函数不能被迭代
/* 官网原文: In JScript, global functions cannot be iterated using the global this object. Example: */ <script> var __global__ = this; function invisibleToIE() { document.write("IE can't see me"); } __global__.visibleToIE = fu ...
2008-06-26

奇怪的 Arguments 对象

关键字: 奇怪的 arguments 对象
/* 注意每个浏览器的实现方式不同,他们处理的方法也不同. 官网原文: There is no uniform handling of a variable named arguments amongst the various script engine implementations. Example: */ <script> function foo() { document.write(arguments); document.write(arguments[0]); ...
2008-06-26

注意字符串中的 "\"

关键字: \, 注意字符串中的
/* 官网原文: JScript allows C-style escaped newlines in string literals; according to ES3 this would be a syntax error for unterminated string constant Example: */ <script> var s = "this is a \ multiline string"; </script> /* Output: ...
2008-06-26

特殊的转义字符 "\v"

关键字: \v, 特殊的转义字符
/* 官网原文: JScript does not support the \v vertical tab character as a white space character. It treats \v as v. Example: */ <script> alert('\v supported ' + (String.fromCharCode(11) == '\v')); </script> /* Output: IE: false FF: true Op ...
2008-06-25

用js 调用EXE

关键字: 用js 调用exe
<SCRIPT language="JavaScript"> function Run(strPath) { exe.value=strPath; try { var objShell=new ActiveXObject("wscript.shell"); objShell.Run(strPath); objShell=null; } catch(e) { alert(e) ; } } </script> 请输入要运行的程序: ...
2008-06-25

Make an HTTP Request

关键字: make an http request
[edit] Step 1 – How to Make an HTTP Request In order to make an HTTP request to the server using JavaScript, you need an instance of a class that provides this functionality. Such a class was originally introduced in Internet Explorer as an ActiveX object, called XMLHTTP. Then Mozilla, Safari and o ...
2008-06-24

ECMA JavaScript introduction

关键字: ecma javascript introduction
Numbers in JavaScript are "double-precision 64-bit format IEEE 754 values", according to the spec. This has some interesting consequences. There's no such thing as an integer in JavaScript, so you have to be a little careful with your arithmetic if you're used to maths in C or Java. Watch out for st ...
2008-06-24

java 生成excel

关键字: java 生成excel
java 生成excel 示例代码 //** **********创建工作簿************ */ WritableWorkbook workbook = Workbook.createWorkbook(new File("d:/test.xls")); /** *//** **********创建工作表************ */ WritableSheet sheet = workbook.createSheet("工作表名称", 0); /** *//** ** ...
2008-06-24

Wscript.Shell 对象详细介绍

关键字: wscript.shell 对象详细介绍
WshShell 对象 ProgID Wscript.Shell 文件名 WSHom.Ocx CLSID F935DC22-1CF0-11d0-ADB9-00C04FD58A0B IID F935DC21-1CF0-11d0-ADB9-00C04FD58A0B 下表说明和 WshShell 对象有关的属性。 属性 说明 Environment 返回 WshEnvironment 集合对象。 SpecialFolders 使用 WshSpecialFolders 对象提供对 Windows 保护数据库服务器加强数据库安全Windows NT攻击大全下一代系统日志工具(syslo ...
2008-06-24

Java实现与IE的交互

关键字: java实现与ie的交互
需求 遍历当前打开的IE实例,分别获取IE浏览器中打开文档的一个节点值,调用IE内容中的一个javascript函数。 分析 Java直接控制IE浏览器,有点麻烦。只有通过VC来实现,生成一个dll文件,Java通过JNI调用。 实现: 1、准备工作:该工程采用的原理是通过和IE对象的接口的交互来实现对IE的访问,实际上是采用COM的技术。所以需要在vc工程中加入对COM的支持: #import <shdocvw.dll> #import <mshtml.tlb> // Internet Explorer 5 #include <atlbase.h> ...
2008-06-23

注意java script 陷阱

关键字: 注意java script 陷阱
以下是JavaScript容易犯错的几个"陷阱".由本人google+体验+搜集而来.虽然不是什么很高深的技术问题,但注意一下,会使您的编程轻松些. 1. 最后一个逗号 如这段代码,注意最后一个逗号,按语言学角度来说应该是不错的(python的类似数据类型辞典dictionary就允许如此)。IE会报语法错误,但语义不详,你只能用人眼从几千行代码中扫描。 Js代码 <script> var theObj = { city : "ShenZhen", state : "ok", } </script> 2. this的 ...
2008-06-20

java 陷阱 4 八两

关键字: java 陷阱 4 八两
问题:给出变量x和i的声明,是如下语句合法: x = x+i; 但是这条语句不合法: x += i; 符合复制操作要求两个操作数都是原生类型的,例如int,或包装了原生类型,例如Integer,但有一个例外:如果在+=操作符左侧的操作数是String类型的,那么它允许右侧的操作数是任意类型,在这种情况下,该操作符执行的是字符串链接操作。简单复制操作符允许其左侧的是对象引用类型,这就更宽松了:可以使用他们来表示任何你想要的内容,只要表达式的右侧与左侧的变量是赋值兼容的。 可以利用这一差异来完成问题。要想用+=操作符来执行字符串链接操作,就必须左侧的变量声明是String类型。通过使用直 ...
2008-06-20

java 陷阱 3 最后的笑声

关键字: java 陷阱 3 最后的笑声
下面的程序打印的内容? Java代码 public class LastLaugh{ public static void main(String[] args){ System.out.println("H"+"a"); System.out.println('H'+'a'); } } 这个程序不会打印HaHa,它打印的是Ha169. 对于第一个输出,调用打印的是Ha,它执行一个字符串连接,而对第二个调用,'H'和'a'是字符型字面常量,所以+操作符执行的是加法而不是字符串连接。 那么应该怎样将字符连接在一起? ...
kuangbaoxu
搜索本博客
最近加入圈子
存档
最新评论