首先准备一个引发异常的方法。1 public static void ThrowException()2 {3 throw new ArgumentException(); 4 }然后在单元测试项目中,写下测试方法。[TestMethod][ExpectedException(typeof...
分类:
其他好文 时间:
2014-09-14 23:20:47
阅读次数:
279
严格模式:不安全的操作将抛出错误。 “use strict” ECMA-262的全部关键字 break do instanceof typeof case else new var catch finally return void continue for switch while debugge...
分类:
编程语言 时间:
2014-09-14 20:43:27
阅读次数:
206
function addEvent(obj,type,fn){ //用于保存上一个事件 var saved = null; //判断是否存在 if(typeof obj['on' + type] == 'function'){ saved = obj['on' ...
分类:
其他好文 时间:
2014-09-13 18:42:45
阅读次数:
166
DataSet ds = new DataSet(); DataTable dt = new DataTable("OrderList"); dt.Columns.Add(new DataColumn("ID", typeof(string))); dt.Columns.Add...
分类:
其他好文 时间:
2014-09-13 17:06:45
阅读次数:
240
概述在项目获取某个元素的值会出现undefined,所以对这种情况要有特殊处理。可通过下面的代码判断是否为undefined类型。1 if (typeof(reValue) == "undefined") { 2 alert("undefined"); 3 } 4 5 typeof 返回的是...
分类:
编程语言 时间:
2014-09-13 09:22:24
阅读次数:
227
/*text方法,给网页元素设置文本值的方法主要处理火狐不支持innerText这个属性的问题。还学习了如何判断一个字符串类型的属性是否存在如果判断一个对象类型的属性是否存在,用if(ele.attr)就行,但是如果判断字符串类型的,则就要if(typeof ele.attr=='string')这...
分类:
其他好文 时间:
2014-09-12 14:44:03
阅读次数:
200
function $$(f) { if (typeof f == 'function') {//f是一个函数 f(); } else { alert('not a function'); } } ...
分类:
编程语言 时间:
2014-09-11 13:51:41
阅读次数:
190
1.反射即是获取一个运行程序或其他程序的元数据2.type类是一个抽象类,不能被实例化,用来包含类型的数据Type t = myInstance.GetType();Type t =Typeof(myInstance);3.特性(attribute)特性是一种向程序集增加元数据的语言结构,特性片被方...
分类:
其他好文 时间:
2014-09-10 00:16:39
阅读次数:
257
In 8.1 we use the below code to navigate between pages:this.Frame.Navigate(typeof(PivotPage));In 8.1 we need to use the event to add hardware back eve...
分类:
其他好文 时间:
2014-09-09 22:43:59
阅读次数:
226
String.prototype.format?=?function(args)?{
????var?result?=?this;
????if?(arguments.length?>?0)?{????
????????if?(arguments.length?==?1?&&?typeof?(args)?==?"ob...
分类:
编程语言 时间:
2014-09-09 21:41:29
阅读次数:
342