欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  web前端

jquery 学习笔记一_jquery

程序员文章站 2022-05-18 23:33:40
...
jquery基本信息

  jquery的官方网站:www.jquery.com

  jquery解释: jquery是javascript的类库,提供了大量的javascript的类库和API,方便javascript开发。

  jquery API中文参考手册: http://jquery-api-zh-cn.googlecode.com/svn/trunk/index.html

前台数据提交到后台demo:

实例图:

  jquery 学习笔记一_jqueryjquery 学习笔记一_jquery

功能点:

  1.使用$("#UserName")获取id为UserName的jquery对象。

  2.使用jquery的get、ajax、load三个方法向后台提交数据。

  3.使用jquery的removeClass和addClass方法修改样式。

  4.encodeURI(username)将字符串转码,防止中文出现乱码,注意后台要用System.Web.HttpUtility.UrlDecode(str,encoding)解码

前台html:

复制代码 代码如下:












请输入名称:

















服务器端代码:
复制代码 代码如下:

protected void Page_Load(object sender, EventArgs e)
{
if (HttpContext.Current.Request.QueryString["m"] != null)
{
//将请求的数据通过GB2312解码
string method = System.Web.HttpUtility.UrlDecode(HttpContext.Current.Request.QueryString["m"], Encoding.GetEncoding("GB2312"));//

HttpContext.Current.Response.Write(method+"已经被验证!");

Response.End();
}
}
相关标签: jquery 学习笔记