05 2013 档案

字符串转json方法
摘要:字符串:"{"Id":3,"Name":"asd","Age":28,"Birthday":"01 1 2012 12:00AM"}"转化方法:var s=JSON.parse('{"Id":3,"Name":"asd","Age":28,"Birthday":"01 1 2012 12:00AM"}')函数:JSON.p 阅读全文

posted @ 2013-05-31 10:51 ~紫鱼~ 阅读(218) 评论(0) 推荐(0)

正则取括号里面的内容
摘要:标题:正则取括号里面的内容正则:1.JS写法:var reg=new RegExp(/(\([^\(\)]*\))/) 2.C#写法://(([^)]*)//)区别就是反转义字符而已记录下 也是群里朋友发的 纯粹记录 阅读全文

posted @ 2013-05-28 14:23 ~紫鱼~ 阅读(3564) 评论(0) 推荐(0)

镶套iframe 鼠标滚动无效解决办法
摘要:背景:frameset 外面镶套一个页面问题:IE鼠标滚动无效,chrome firfox 支持解决:内页传递给父页进行滚动代码: <script type="text/javascript"> window.onload = function () { obj = window.parent.parent.document; if (obj != null && obj != undefined) { var a = ["DOMMouseScroll", "mousewheel"], ... 阅读全文

posted @ 2013-05-27 10:04 ~紫鱼~ 阅读(2022) 评论(1) 推荐(0)

Ajax调用WCF报405错误
摘要:环境:jquery1.8.1+Wcf(IIS托管)错误:405错误(方法不被允许)原因:ajax跨域调用错误解决办法:1.在发布WCF上面允许crossDomainScriptAccessEnabled<system.serviceModel> <behaviors> <endpointBehaviors> <behavior name="JSONPAspNetAjaxBehavior"> <enableWebScript /> </behavior> ... 阅读全文

posted @ 2013-05-13 13:55 ~紫鱼~ 阅读(3044) 评论(0) 推荐(0)

string[] 转int[] 的方法
摘要:首先感谢群里一位兄弟老A,让我更加熟悉了string[] 转int[] 方法。废话不多说,直接贴代码:背景:string[] listString = new string[] { "1", "2", "3" };方法1-迭代: int[] c = new int[listString.Length]; 09 for(int i = 0; i < listString.Length; i++) { 10 c[i] = Convert.ToInt32(listString[i].ToString()); 11 } 12 retur 阅读全文

posted @ 2013-05-10 12:19 ~紫鱼~ 阅读(476) 评论(0) 推荐(0)

jquery 获取复选框 选中的值
摘要:环境:jquery-1.8.0.min.js方法1: $("input:checked").each(function () { });方法2: $("input[name='sel']:checked").each(function () { });记录下,老是忘记! 阅读全文

posted @ 2013-05-06 18:55 ~紫鱼~ 阅读(178) 评论(0) 推荐(0)

http改成https wcf 配置更改
摘要:最近有个内部系统要对外公开,要开启https ,所有模块都正常运行,但偏偏服务层出问题了。The HttpGetEnabled property of ServiceMetadataBehavior is set to true and the HttpGetUrl property is a relative address, but there is no http base address. Either supply an http base address or set HttpGetUrl to an absolute address.从上面的字面告诉我们,元数据被设置true . 阅读全文

posted @ 2013-05-03 17:17 ~紫鱼~ 阅读(1649) 评论(0) 推荐(0)

EF 读取视图数据重复的BUG 解决
摘要:环境:EF5.1+视图问题:查询的数据重复原因:视图没有主键解决:1.给当前视图的类增加一个实体键(我用的) 2.用EF自带的SQL进行查询我目前只知道这2个办法,希望路过的大牛,帮忙解决下 !谢谢 阅读全文

posted @ 2013-05-02 13:11 ~紫鱼~ 阅读(1948) 评论(1) 推荐(0)