博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

2012年9月3日

摘要: http://www.cnblogs.com/walkerwang/archive/2011/03/03/1970330.html 阅读全文

posted @ 2012-09-03 14:41 oilsun 阅读(112) 评论(0) 推荐(0) 编辑

摘要: 数组的一些方法:1.join()和split()方法 <script type="text/javascript">var x;var a=new Array();a[0]="XHTML";a[1]="CSS";a[2]="JavaScript";alert(a.join());alert(typeof(a.join));alert(typeof(a));</script>join() 方法用于把数组中的所有元素放入一个字符串。元素是通过指定的分隔符进行分隔的。指定分隔符方法join(&qu 阅读全文

posted @ 2012-09-03 14:40 oilsun 阅读(577) 评论(2) 推荐(1) 编辑

摘要: string字符串是char的集合,而char是Unicode的代码,所以char可以转化为int。字符串在参数传递时为引用传递;可以使用空字符串("")。一、字符串类型转换1.转为char可以用索引器来得到字符串中指定的字符,如:string myString="hello";char myChars;myChars=myString[0];要想得到一个char数组可以用如下方法:char[] myChars = myString.ToCharArray();char[]与string的不同之处在于char[]可以读写,而string只能读(改写只是对 阅读全文

posted @ 2012-09-03 14:39 oilsun 阅读(228) 评论(0) 推荐(0) 编辑

摘要: PDF 浏览:http://www.tracefact.net/Document/Delegates-and-Events-in-CSharp.pdf文中代码在VS2005下通过,由于VS2003(.Net Framework 1.1)不支持隐式的委托变量,所以如果在一个接受委托类型的位置直接赋予方法名,在VS2003下会报错,解决办法是显式的创建一个委托类型的实例(委托变量)。例如:委托类型 委托实例 = new 委托类型(方法名); 欢迎浏览本文的后续文章: C#中的委托和事件(续)源码下载:http://www.tracefact.net/SourceCode/Delegates-and 阅读全文

posted @ 2012-09-03 14:38 oilsun 阅读(578) 评论(0) 推荐(0) 编辑

摘要: c#中Split分割字符串的几种方法作者:vegas 发布日期:2008.03.21 1,461 views 所属分类:C#最近经常看到论坛中许多帖子询问如何使用split来分割字符串,我这里对split做一些简单的总结,希望能够对大家有所帮助。下面介绍几种方法:第一种方法:打开vs.net新建一个控制台项目。然后在Main()方法下输入下面的程序。string s="abcdeabcdeabcde";string[] sArray=s.Split('c');foreach(string i in sArray)Console.WriteLine(i.ToS 阅读全文

posted @ 2012-09-03 14:37 oilsun 阅读(486) 评论(0) 推荐(0) 编辑

摘要: 一.使用ajax与服务器交互 不管是post方式还是get方式都应该对中文进行编码 只有这样 服务器端(ie浏览器 firefox不用)才能正确解析汉字 否则就是乱码。二.在asp.net MVC中 ie跟firefox对下载文件名的处理不同 / ie通过编码实现正确的文件名/ public FileContentResult DownLoad() { string temp = "我是中国人!"; return File(System.Text.Encoding.UTF8.GetBytes(temp), "text/plain",Url.Encode( 阅读全文

posted @ 2012-09-03 14:32 oilsun 阅读(424) 评论(0) 推荐(0) 编辑

摘要: 本文和大家讲一下ASP.NET MVC中实用的保存文件方法,在Controller 中我们可以使用 FileResult 向客户端发送文件。FileResultFileResult 是一个抽象类,继承自 ActionResult。在 System.Web.Mvc.dll 中,它有如上三个子类,分别以不同的方式向客户端发送文件。在实际使用中我们通常不需要直接实例化一个 FileResult 的子类,因为 Controller 类已经提供了六个 File 方法来简化我们的操作:Code [http://www.haoyy.com]protected internal FilePathResult 阅读全文

posted @ 2012-09-03 14:32 oilsun 阅读(350) 评论(0) 推荐(0) 编辑

摘要: http://diqizhan.iteye.com/blog/579427 阅读全文

posted @ 2012-09-03 14:30 oilsun 阅读(175) 评论(0) 推荐(0) 编辑

摘要: if you want hurry, test$(".ui-jqgrid-titlebar").hide();or if you have multiple grids, then only hide titlebar of $("#grid"), then do$("#gview_grid > .ui-jqgrid-titlebar").hide() 阅读全文

posted @ 2012-09-03 14:29 oilsun 阅读(1075) 评论(0) 推荐(0) 编辑

摘要: JQuery中的AjaxForm和AjaxSubmit使用差不多功能也差不多。很容易误解。按照作者的解释:AjaxFormajaxForm不能提交表单。在document的ready函数中,使用ajaxForm来为AJAX提交表单进行准备。提交动作必须由submit开始ajaxSubmit马上由AJAX来提交表单。你可以在任何情况下进行该项提交。option的参数var options = { target: '#output1', // target element(s) to be updated with server response ... 阅读全文

posted @ 2012-09-03 14:26 oilsun 阅读(1174) 评论(0) 推荐(0) 编辑

摘要: 注:经过验证,formValidator只适合一个页面不超过一个表单的情况。 本例实现功能:通过ajax提交表单,并在提交表单前对表单的数据进行验证。主要通过两个插件实现:第一个:jQuery Form Pluginhttp://jquery.malsup.com/form 主要功能是ajax提交表单第二个:jQuery formValidator 国产强大的表单验证插件。 http://www.cnblogs.com/wzmaodong 最简单的例子如下: <html> <head> <title>Form</title> <!-- 引入 阅读全文

posted @ 2012-09-03 14:21 oilsun 阅读(769) 评论(0) 推荐(0) 编辑

摘要: jQuery UI很强大,其中的日期选择插件Datepicker是一个配置灵活的插件,我们可以自定义其展示方式,包括日期格式、语言、限制选择日期范围、添加相关按钮以及其它导航等。官方地址:http://docs.jquery.com/UI/Datepicker,官方示例: http://jqueryui.com/demos/datepicker/。一个不错的地址,用来DIY jQuery UI界面效果的站点http://jqueryui.com/themeroller/DatePicker基本使用方法:<!DOCTYPEhtml><html><head>&l 阅读全文

posted @ 2012-09-03 14:15 oilsun 阅读(160) 评论(0) 推荐(0) 编辑

摘要: 摘要:jQuery的.bind()、.live()和.delegate()之间的区别并非总是那么明显的,然而,如果我们对所有的不同之处都有清晰的理解的话,那么这将会有助于我们编写出更加简洁的代码,以及防止在交互应用中弹出错误。 基本要素 DOM树 首先,可视化一个HMTL文档的DOM树是很有帮助的。一个简单的HTML页面看起来就像是这个样子: 事件冒泡(又称事件传播) 当我们点击一个链接时,其触发了链接元素的单击事件,该事件则引发任何我们已绑定到该元素的单击事件上的函数的执行。 $('a').bind('click', function() { alert(&q 阅读全文

posted @ 2012-09-03 14:11 oilsun 阅读(130) 评论(0) 推荐(0) 编辑

摘要: jquery的delegate有好几个缺憾。----或许是因为sizzle少提供了以refEl为参考、一个按selector来筛选els的filter(els,selector,refEl)的功能,jq需要自己去实现类似的功能。其一:selector是基于:root的,而不是:scope的。所以,在写代码时,需要带上scrope的定位部分。----注::root指document根节点,:scope指代理节点例如,代理div1的儿子,需要这样写:$('#div1').delegate('#div1>*','click',fun});而不是这 阅读全文

posted @ 2012-09-03 14:02 oilsun 阅读(140) 评论(0) 推荐(0) 编辑

摘要: Java代码 <script>jQuery("#grid_id").jqGrid({...colModel:[{name:'recommendation',index:'recommendation',width:100,align:"center",editable:true,formatter:'select',editoptions:{value:'0:未推荐;1:已推荐'}}...]...});</script>将数据库记录为0的格式化为“未推荐”, 记录为1 阅读全文

posted @ 2012-09-03 14:01 oilsun 阅读(194) 评论(0) 推荐(0) 编辑

摘要: //=========$(window).resize(function(){ $("#confTable").setGridWidth($(this).width()*.95); });原问题代码:??0 down vote favorite1I have a jqGrid at my web page. I have a resizing problem. When I restore down my web page, all the elements at my page resizes automatically however my jqGrid table d 阅读全文

posted @ 2012-09-03 14:00 oilsun 阅读(360) 评论(0) 推荐(0) 编辑

摘要: 1 down vote acceptedThere are some small problems which follow to the problem.The first problem. You should move the lines where you call navGrid and gridResize inside of success handler. So the navigator and the resizing element of the grid will be created after ther grid will be created.You uses r 阅读全文

posted @ 2012-09-03 13:57 oilsun 阅读(323) 评论(0) 推荐(0) 编辑

摘要: //返回CELL=[]的时候,提示 <script type="text/javascript"> //<![CDATA[ $(document).ready(function () { var grid = $('#oversight-sample'); var pages = []; // not as {}; var emptyMsgDiv = $('<div>No URLs have been loaded for evaluation.</div>'); grid.jqGrid... 阅读全文

posted @ 2012-09-03 13:55 oilsun 阅读(139) 评论(0) 推荐(0) 编辑

摘要: 遇到一个问题:表单输入框设置了文字,然后使用jQuery的焦点停留设置办法focus()进行处理。结果发现光标位置在firefox下停留的位置不对——停留在文字的最前边!只有IE浏览器下是正常的。这样的话肯定是不行的,于是想办法进行处理。终于找到了一些解决办法,效果如下代码有很多种,下面给出:方法一:function setSelectionRange(input, selectionStart, selectionEnd) { if (input.setSelectionRange) { input.focus(); input.setSelectionRange(select... 阅读全文

posted @ 2012-09-03 13:54 oilsun 阅读(1060) 评论(0) 推荐(0) 编辑

摘要: 1.定义函数/// /// C#日期比较计算两个日期的时间间隔 /// /// 第一个日期和时间 /// 第二个日期和时间 /// private string DateDiff(DateTime DateTime1, DateTime DateTime2) { string dateDiff = null; TimeSpan ts1 = new TimeSpan(DateTime1.Ticks); TimeSpan ts2 = new TimeSpa... 阅读全文

posted @ 2012-09-03 13:46 oilsun 阅读(4767) 评论(0) 推荐(0) 编辑