摘要:
jQeury顶级对象 缩写$1、$(document).ready(function(){})dom加载完成后触发window.onload只能注册一个方法页面所有内容加载完成后触发(图片,css,js都加载)缩写$(function(){})2、jQuery对象(包装集) dom对象var div = document.getElementById("id") dom对象var div = $(".class") 包装集,对dom对象包装,返回的是很多个dom对象3、jQeury选择器$("#id")$(".class&q 阅读全文
摘要:
using System;using System.Web;using System.Drawing;using System.Web.SessionState;public class ValidateCode : IHttpHandler,IRequiresSessionState { public void ProcessRequest(HttpContext context) { //System.Threading.Thread.Sleep(5000); context.Response.ContentType = "image/jpeg"; ... 阅读全文
摘要:
//点击按钮添加评论 $("#btn").click(function (){ var content =$("#txtContent").val(); var id=$("#txtId").val(); var data="content="+content+"&id="+id +"&time="+new Date().getTime(); $.post("AddComment.ashx",dat... 阅读全文
摘要:
$.getJSON("Photolist.ashx",function (msg){ //每次加载之前清空 $("#content").html(""); //动态创建table var table=$("<table id='pList'></table>"); //添加表头 table.append($("<tr><th>序号</th><th>名字</th><th>照片</th> 阅读全文
摘要:
<asp:ListView ID="ListView1" InsertItemPosition="LastItem" DataKeyNames="PId" runat="server" DataSourceID="ObjectDataSource1" > <ItemTemplate> <tr style=""> <td> <asp:Label ID="PIdLabel" runat="serv 阅读全文
摘要:
<asp:GridView ID="GridView1" runat="server" AllowPaging="True" DataSourceID="ObjectDataSource1" PageSize="2"> <Columns> <asp:CommandField ShowDeleteButton="True" ShowEditButton="True" /> </Columns> </asp 阅读全文
摘要:
<asp:DataList ID="DataList1" runat="server" CellPadding="4" DataSourceID="ObjectDataSource1" ForeColor="#333333" Width="243px" oncancelcommand="DataList1_CancelCommand" ondeletecommand="DataList1_DeleteCommand" onedit 阅读全文
摘要:
public void ProcessRequest (HttpContext context) { context.Response.ContentType = "image/jpeg"; //url传来的图片名 string img = context.Request.QueryString["img"]; if (!string .IsNullOrEmpty(img)) { //获取图片的物理路径 string path = context.Request.MapPath("... 阅读全文
摘要:
#region +AJAX获得功能页码条 /// <summary> /// AJAX获得功能页码条 /// </summary> /// <param name="funName">js方法名</param> /// <param name="allrecord">全部记录条数</param> /// <param name="allpage">全部页面数</param> /// <param name="curpage& 阅读全文
摘要:
function MsgBox(s) {//{imghref:图片文件夹所在路径,waitImg:等待图片名,bgImg:背景图片名} var secondConst = 2000;//系统默认显示时间 var secondWait = 2000;//显示时间 var timer;//计时器 var lf, tp;//左边距,顶边距 var paras = {}; //json参数 function readyMsgBox() { if (s != null){ if (s.imghref != null) paras.i... 阅读全文
摘要:
//使用浏览器兼容的方式创建 异步对象function createXhr() { var xhobj = false; try { xhobj = new ActiveXObject("Msxml2.XMLHTTP"); // ie msxml3.0+ } catch (e) { try { xhobj = new ActiveXObject("Microsoft.XMLHTTP"); //ie msxml2.6 } catch (e2) { xhobj = false; }... 阅读全文
摘要:
tbObj = gel("tbList");//获取表格对象//参数是后台返回的数据长度 function createTableTr(jsonArr) { var arrLength = jsonArr.length; for (var i = 0; i < arrLength; i++) { var json = jsonArr[i]; //在表格最后追加一个行对象 var newRow = tbObj.insertRow(-1); ... 阅读全文
摘要:
<select id="selCate"></select>function createSelectOption(cateJsonArr) { var sel = gel("selCate"); for (var i = 0; i < cateJsonArr.length; i++) { var cateJson = cateJsonArr[i]; //创建一个下拉框选项 (显示的文本 选项的值) var opt = new Option(cateJson.N... 阅读全文
摘要:
cs://repeater的databound事件 protected void RptBig_ItemDataBound(object sender, RepeaterItemEventArgs e) { //此处必须做判断,不然下面获取数据会报没有实例化或者为空 if (e.Item.ItemType== ListItemType.Item||e.Item.ItemType== ListItemType.AlternatingItem) { Repeater rptSma... 阅读全文