热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

后台全选功能以及数据的提交方法

销售品牌厂家:

  <tr><td class&#61;"htd" valign&#61;"top" align&#61;"right">                     销售品牌/厂家&#xff1a;                 td>                 <td align&#61;"left">                 <asp:HiddenField ID&#61;"hidCarsBrand" runat&#61;"server" />                     <table width&#61;"100%">                            <asp:Repeater ID&#61;"rptbrand" runat&#61;"server">                             <ItemTemplate>                                 <tr tid&#61;&#39;series&#39;>                                     <td style&#61;"border-bottom1px solid #888888;">                                         <input type&#61;"checkbox" id&#61;"s<%#Eval("InputID") %>tag&#61;"brands" />                                         <label for&#61;"s<%#Eval("InputID") %>">                                             <%#Eval("BrandName")%>label>                                     td>                                 tr>                                 <tr tid&#61;&#39;list&#39;>                                     <td style&#61;"border-bottom1px solid #000000;">                                         <uc1:CarByCompany ID&#61;"CarByCompany1" runat&#61;"server" InputID&#61;&#39;<%#Eval("InputID") %>&#39; />                                     td>                                 tr>                             ItemTemplate>                         asp:Repeater>                     table>                     <%--                                                                                                                               --%>                 td>             tr>

 <script src&#61;"../../Scripts/jquery-1.4.1.min.js" type&#61;"text/Javascript">script>     <script type&#61;"text/Javascript">         jQuery(document).ready(function () {             jQuery("#ctl00_ContentPlaceHolder1_btnSave").click(function () {                 var result &#61; "";                 jQuery("input[type&#61;&#39;checkbox&#39;]").filter("[tag&#61;&#39;brands&#39;]").each(function () {                     if (jQuery(this).attr("checked") &#61;&#61; true) {                         result &#61; result &#43; jQuery(this).attr("id") &#43; ",";                     }                 });                 jQuery("#ctl00_ContentPlaceHolder1_hidCarsBrand").val(result);                 return true;             });             //关联品牌全选(取消全选)操作             jQuery("tr[tid&#61;&#39;series&#39;]").each(function () {                 var tmp &#61; jQuery(this);                 tmp.find("input[type&#61;&#39;checkbox&#39;]").filter("[tag&#61;&#39;brands&#39;]").click(function () {                     if (jQuery(this).attr("checked")) {                         tmp.next("tr[tid&#61;&#39;list&#39;]").find("table input[type&#61;&#39;checkbox&#39;]").filter("[tag&#61;&#39;brands&#39;]").each(function () {                             jQuery(this).attr("checked", true);                         });                     } else {                         tmp.next("tr[tid&#61;&#39;list&#39;]").find("table input[type&#61;&#39;checkbox&#39;]").filter("[tag&#61;&#39;brands&#39;]").each(function () {                             jQuery(this).attr("checked", false);                         });                     }                 });             });             //关联厂家操作(若一个选中则品牌必须选中,如所有都不选。则厂家也取消)             jQuery("tr[tid&#61;&#39;list&#39;]").each(function () {                 var tmp &#61; jQuery(this);                 var flag &#61; false;                 tmp.find("table input[type&#61;&#39;checkbox&#39;]").filter("[tag&#61;&#39;brands&#39;]").click(function () {                     //判断厂家是否有选中的项                     if (jQuery(this).attr("checked")) {                         tmp.prev("tr[tid&#61;&#39;series&#39;]").find("input[type&#61;&#39;checkbox&#39;]").filter("[tag&#61;&#39;brands&#39;]").attr("checked", true);                     } else {                         flag &#61; false;                     }                     tmp.find("table input[type&#61;&#39;checkbox&#39;]").filter("[tag&#61;&#39;brands&#39;]").each(function () {                         if (jQuery(this).attr("checked")) {                             flag &#61; true;                         }                     });                     if (!flag) {                         tmp.prev("tr[tid&#61;&#39;series&#39;]").find("input[type&#61;&#39;checkbox&#39;]").filter("[tag&#61;&#39;brands&#39;]").attr("checked", false);                     }                 });             });         });     script>

CarByCompany.ascx

<table><tr>         <asp:Repeater ID&#61;"rptCompany" runat&#61;"server">             <ItemTemplate>                 <td>                     <input type&#61;"checkbox" id&#61;"c<%#Eval("InputID") %>"  tag&#61;"brands" />                     <label for&#61;"c<%#Eval("InputID") %>">                         <%#Eval("CompanyName")%>                     label>                 td>             ItemTemplate>         asp:Repeater>     tr> table>

CarByCompany.ascx.cs文件代码&#xff1a;

 public object InputID{set;get;}protected void Page_Load(object sender, EventArgs e)     {         if (!IsPostBack)         {             int id &#61; Convert.ToInt32(InputID);             using (dcauto2012Entities db &#61; new dcauto2012Entities())             {                 IList<Company> list &#61; db.Company.OrderByDescending(o &#61;> o.CompanyID)                 .Where(o &#61;> o.BrandID &#61;&#61; id)                 .Where(o &#61;> o.ISDongChang &#61;&#61; 0)                 .Where(o &#61;> o.InputID !&#61; 31)                 .ToList();                 rptCompany.DataSource &#61; list;                 rptCompany.DataBind();             }         }     }


add.aspx.cs

using System;
using System.Data;
using System.Configuration;
using System;
using System.Collections.Generic;
using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using dcauto.Utils; using EFDAL; using System.Data; using System.Data.Objects; using Webdiyer.WebControls.Mvc; using System.IO; public partial class manage_car_fourS_add : System.Web.UI.Page {     int currentid;     protected void Page_Load(object sender, EventArgs e)     {         ((manage_car_carfoursinfomaster)this.Master).txtTitle &#61; "4S店添加";         if (!this.IsPostBack)            {             using (dcauto2012Entities db &#61; new dcauto2012Entities())             {                 WebUtil.CtrlToList(rptbrand, db.Brand.OrderBy(o &#61;> o.ISDongChang).OrderBy(o &#61;> o.Orders).OrderBy(o &#61;> o.BrandID).Where(o &#61;> o.ISDongChang &#61;&#61; 0).Where(s &#61;> s.InputID !&#61; 5).ToList());             }         }     }     protected void btnSave_Click(object sender, ImageClickEventArgs e)     {         string[] borf &#61; hidCarsBrand.Value.Split(",".ToCharArray(), StringSplitOptions.RemoveEmptyEntries);         int flag &#61; 0;         if (borf.Length > 0)         {             flag &#61; 1;         }         if (flag &#61;&#61; 0)         {             jsHint.Alert("请选择至少一个品牌.若没有则先添加品牌后进行添加4S店");         }         else         {             FourS model &#61; new FourS();             model.Name &#61; txtpname.Text;             model.Adress &#61; txtadress.Text;             model.Content &#61; txtcontent.Text;             string picstr &#61; "";             if (f1.HasFile)             {                 string _imgpath &#61; globalVariables.NewFileName &#43; Path.GetExtension(f1.FileName).ToLower();                 f1.PostedFile.SaveAs(globalVariables.CarsPic &#43; _imgpath);                 model.Pic &#61; _imgpath;             }             string picstr1 &#61; "";             if (f2.HasFile)             {                 picstr1 &#61; globalVariables.NewFileName &#43; Path.GetExtension(f2.FileName).ToLower();                 f2.PostedFile.SaveAs(globalVariables.CarsPic &#43; picstr1);                 model.Map &#61; picstr1;             }             string picstr3 &#61; "";             if (f3.HasFile)             {                 picstr3 &#61; globalVariables.NewFileName &#43; Path.GetExtension(f3.FileName).ToLower();                 f3.PostedFile.SaveAs(globalVariables.CarsPic &#43; picstr3);                 model.Pic2 &#61; picstr3;             }             model.Url &#61; TextBox1.Text;             model.Zip &#61; TextBox2.Text;             model.Selltel1 &#61; TextBox3.Text;             model.Selltel2 &#61; TextBox4.Text;             model.Servtel1 &#61; TextBox5.Text;             model.Servtel2 &#61; TextBox6.Text;             model.Fax &#61; TextBox7.Text;             model.Email &#61; TextBox8.Text;             model.Companyurl &#61; txtcompanyintro.Text;             model.Mapurl &#61; txtmapurl.Text;             int userid &#61; 1;             if (Session["UserId"] &#43; "" !&#61; "")                 userid &#61; int.Parse(Session["UserId"] &#43; "");             model.Datetime &#61; DateTime.Now;             model.AddUser &#61; Session["loginname"] &#43; "";             model.AddUserid &#61; userid;             model.ModUser &#61; Session["loginname"] &#43; "";             model.ModUserid &#61; userid;             try             {                 using (dcauto2012Entities db &#61; new dcauto2012Entities())                 {                     db.FourS.AddObject(model);                     db.SaveChanges();                     var brandid &#61; 0;                     foreach (string item in borf)                     {                         string witch &#61; item.Substring(0, 1);                         string id &#61; item.Replace("c", "").Replace("s", "");                         EFDAL.FourSunion fs &#61; new FourSunion();                         fs.FourSid &#61; model.FourSid;                         if (witch &#61;&#61; "s")                         {                             brandid &#61; int.Parse(id);                             fs.Brandid &#61; brandid;                                                     }                         if (witch &#61;&#61; "c")                         {                             fs.Brandid &#61; brandid;                             fs.Companyid &#61; int.Parse(id);                             db.FourSunion.AddObject(fs);                             db.SaveChanges();                         }                                                                     }                 }                 jsHint.Confirm("添加成功&#xff0c;是否继续添加&#xff1f;", "fourS.asp", "fourS_add.aspx");             }             catch (Exception)             {                 jsHint.toUrl("添加失败!", "fourS.aspx");             }         }     } }

编辑修改&#xff1a;

<script src&#61;"../../Scripts/jquery-1.4.1.min.js" type&#61;"text/Javascript">script>     <script type&#61;"text/Javascript">         $(document).ready(function () {             var ids &#61; $("#ctl00_ContentPlaceHolder1_hidCarsBrand").val();             try {                 if (ids !&#61; null) {                     var items &#61; ids.split(",");                 }                 for (var i &#61; 0; i < items.length; i&#43;&#43;) {                     $("#" &#43; items[i]).attr("checked", true)                 }             }             catch (E) { }             $("#ctl00_ContentPlaceHolder1_hidCarsBrand").val("");             $("#ctl00_ContentPlaceHolder1_btnSave").click(function () {                 var result &#61; "";                 $("input[type&#61;&#39;checkbox&#39;]").filter("[tag&#61;&#39;brands&#39;]").each(function () {                     if ($(this).attr("checked") &#61;&#61; true) {                         result &#61; result &#43; $(this).attr("id") &#43; ",";                     }                 });                 $("#ctl00_ContentPlaceHolder1_hidCarsBrand").val(result);                 return true;             });             //关联车型全选(取消全选)操作             $("tr[tid&#61;&#39;series&#39;]").each(function () {                 var tmp &#61; $(this);                 tmp.find("input[type&#61;&#39;checkbox&#39;]").filter("[tag&#61;&#39;brands&#39;]").click(function () {                     if ($(this).attr("checked")) {                         tmp.next("tr[tid&#61;&#39;list&#39;]").find("table input[type&#61;&#39;checkbox&#39;]").filter("[tag&#61;&#39;brands&#39;]").each(function () {                             $(this).attr("checked", true);                         });                     } else {                         tmp.next("tr[tid&#61;&#39;list&#39;]").find("table input[type&#61;&#39;checkbox&#39;]").filter("[tag&#61;&#39;brands&#39;]").each(function () {                             $(this).attr("checked", false);                         });                     }                 });             });             //关联车型二级操作(若一个选中则一级必须选中,如所有都不选。则一级也取消)             $("tr[tid&#61;&#39;list&#39;]").each(function () {                 var tmp &#61; $(this);                 var flag &#61; false;                 tmp.find("table input[type&#61;&#39;checkbox&#39;]").filter("[tag&#61;&#39;brands&#39;]").click(function () {                     //判断二级是否有选中的项                     if ($(this).attr("checked")) {                         tmp.prev("tr[tid&#61;&#39;series&#39;]").find("input[type&#61;&#39;checkbox&#39;]").filter("[tag&#61;&#39;brands&#39;]").attr("checked", true);                     } else {                         flag &#61; false;                     }                     tmp.find("table input[type&#61;&#39;checkbox&#39;]").filter("[tag&#61;&#39;brands&#39;]").each(function () {                         if ($(this).attr("checked")) {                             flag &#61; true;                         }                     });                     if (!flag) {                         tmp.prev("tr[tid&#61;&#39;series&#39;]").find("input[type&#61;&#39;checkbox&#39;]").filter("[tag&#61;&#39;brands&#39;]").attr("checked", false);                     }                 });             });         });     script>


后台保存代码&#xff1a;

using System;
using System.Data;
using System.Configuration;
using System;
using System.Collections.Generic;
using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using dcauto.Utils; using EFDAL; using System.Data; using System.Data.Objects; using Webdiyer.WebControls.Mvc; using System.IO; public partial class manage_car_fourS_edit : BasePage {     int currentid;     protected void Page_Load(object sender, EventArgs e)     {         ((manage_car_carfoursinfomaster)this.Master).txtTitle &#61; "4S店修改";         if (!this.IsPostBack)         {             using (dcauto2012Entities db &#61; new dcauto2012Entities())             {                 WebUtil.CtrlToList(rptbrand, db.Brand.OrderBy(o &#61;> o.ISDongChang).OrderBy(o &#61;> o.Orders).OrderBy(o &#61;> o.BrandID).Where(o &#61;> o.ISDongChang &#61;&#61; 0).Where(s &#61;> s.InputID !&#61; 5).ToList());             }             if (!string.IsNullOrEmpty(Request["Id"]))                 InitCtrl(Convert.ToInt32(int.Parse(Request["Id"])));         }     }     private void InitCtrl(int id)     {         using (dcauto2012Entities db &#61; new dcauto2012Entities())         {             currentid &#61; id;             FourS model &#61; db.FourS.Where(s &#61;> s.FourSid &#61;&#61; id).FirstOrDefault();             this.txtpname.Text &#61; model.Name;             this.txtadress.Text &#61; model.Adress;             this.txtcontent.Text &#61; model.Content;             TextBox1.Text &#61; model.Url;             TextBox2.Text &#61; model.Zip;             TextBox3.Text &#61; model.Selltel1;             TextBox4.Text &#61; model.Selltel2;             TextBox5.Text &#61; model.Servtel1;             TextBox6.Text &#61; model.Servtel2;             TextBox7.Text &#61; model.Fax;             TextBox8.Text &#61; model.Email;             txtcompanyintro.Text &#61; model.Companyurl;             txtmapurl.Text &#61; model.Mapurl;             if (!string.IsNullOrEmpty(model.Pic))             {                 this.f1error.Text &#61; "globalVariables.CarsPicUrl &#43; model.Pic &#43; " width&#61;100 height&#61;100>";             }             if (!string.IsNullOrEmpty(model.Map))             {                 this.f2error.Text &#61; "globalVariables.CarsPicUrl &#43; model.Map &#43; " width&#61;100 height&#61;100>";             }             if (!string.IsNullOrEmpty(model.Pic2))             {                 this.f3error.Text &#61; "globalVariables.CarsPicUrl &#43; model.Pic2 &#43; " width&#61;100 height&#61;100>";             }             IList<FourSunion> list &#61; db.FourSunion.Where(s &#61;> s.FourSid &#61;&#61; id).OrderByDescending(s &#61;> s.FourSunionid).ToList();             System.Text.StringBuilder result &#61; new System.Text.StringBuilder();             foreach (FourSunion item in list)             {                 if (item.Companyid !&#61; null && item.Brandid !&#61; null)                 {                     result.Append("s");                     result.Append(item.Brandid);                     result.Append(",");                 }                 if (item.Companyid !&#61; null && item.Brandid !&#61; null)                 {                     result.Append("c");                     result.Append(item.Companyid);                     result.Append(",");                 }             }             hidCarsBrand.Value &#61; result.ToString();         }     }     public void db1_Click(object sender, EventArgs e)     {         using (dcauto2012Entities db &#61; new dcauto2012Entities())         {             int foursid &#61; Convert.ToInt32(Request.Params["Id"]);             FourS model &#61; db.FourS.Where(s &#61;> s.FourSid &#61;&#61; foursid).FirstOrDefault();             model.Pic &#61; "";             db.SaveChanges();             f1error.Text &#61; "";         }     }     public void db2_Click(object sender, EventArgs e)     {         using (dcauto2012Entities db &#61; new dcauto2012Entities())         {             int foursid &#61; Convert.ToInt32(Request.Params["Id"]);             FourS model &#61; db.FourS.Where(s &#61;> s.FourSid &#61;&#61; foursid).FirstOrDefault();             model.Map &#61; "";             db.SaveChanges();             f2error.Text &#61; "";         }     }     public void db3_Click(object sender, EventArgs e)     {         using (dcauto2012Entities db &#61; new dcauto2012Entities())         {             int foursid &#61; Convert.ToInt32(Request.Params["Id"]);             FourS model &#61; db.FourS.Where(s &#61;> s.FourSid &#61;&#61; foursid).FirstOrDefault();             model.Pic2 &#61; "";             db.SaveChanges();             f3error.Text &#61; "";         }     }           protected void btnSave_Click(object sender, ImageClickEventArgs e)     {         using (dcauto2012Entities db &#61; new dcauto2012Entities())         {             int foursid &#61; Convert.ToInt32(Request.Params["Id"]);             FourS model &#61; db.FourS.Where(s &#61;> s.FourSid &#61;&#61; foursid).FirstOrDefault();             model.Name &#61; txtpname.Text;             model.Adress &#61; txtadress.Text;             model.Content &#61; txtcontent.Text;             string picstr &#61; "";             if (f1.HasFile)             {                 string _imgpath &#61; globalVariables.NewFileName &#43; Path.GetExtension(f1.FileName).ToLower();                 f1.PostedFile.SaveAs(globalVariables.CarsPic &#43; _imgpath);                 model.Pic &#61; _imgpath;             }             string picstr1 &#61; "";             if (f2.HasFile)             {                 picstr1 &#61; globalVariables.NewFileName &#43; Path.GetExtension(f2.FileName).ToLower();                 f2.PostedFile.SaveAs(globalVariables.CarsPic &#43; picstr1);                 model.Map &#61; picstr1;             }             string picstr3 &#61; "";             if (f3.HasFile)             {                 picstr3 &#61; globalVariables.NewFileName &#43; Path.GetExtension(f3.FileName).ToLower();                 f3.PostedFile.SaveAs(globalVariables.CarsPic &#43; picstr3);                 model.Pic2 &#61; picstr3;             }             model.Url &#61; TextBox1.Text;             model.Zip &#61; TextBox2.Text;             model.Selltel1 &#61; TextBox3.Text;             model.Selltel2 &#61; TextBox4.Text;             model.Servtel1 &#61; TextBox5.Text;             model.Servtel2 &#61; TextBox6.Text;             model.Fax &#61; TextBox7.Text;             model.Email &#61; TextBox8.Text;             model.Companyurl &#61; txtcompanyintro.Text;             model.Mapurl &#61; txtmapurl.Text;             int userid &#61; 1;             if (Session["UserId"] &#43; "" !&#61; "")                 userid &#61; int.Parse(Session["UserId"] &#43; "");             model.Datetime &#61; DateTime.Now;             model.AddUser &#61; Session["loginname"] &#43; "";             model.AddUserid &#61; userid;             model.ModUser &#61; Session["loginname"] &#43; "";             model.ModUserid &#61; userid;             try             {                 db.SaveChanges();                 string[] borf &#61; hidCarsBrand.Value.Split(",".ToCharArray(), StringSplitOptions.RemoveEmptyEntries);                 IList<FourSunion> list &#61; db.FourSunion.Where(s &#61;> s.FourSid &#61;&#61; model.FourSid).OrderByDescending(s &#61;> s.FourSunionid).ToList();                 for (int i &#61; 0; i < list.Count; i&#43;&#43;)                 {                     db.FourSunion.DeleteObject(list[i]);                 }                                 db.SaveChanges();                 var brandid &#61; 0;                 foreach (string item in borf)                 {                     string witch &#61; item.Substring(0, 1);                     string id &#61; item.Replace("c", "").Replace("s", "");                     EFDAL.FourSunion fs &#61; new FourSunion();                     fs.FourSid &#61; model.FourSid;                     if (witch &#61;&#61; "s")                     {                         brandid &#61; int.Parse(id);                         fs.Brandid &#61; brandid;                     }                     if (witch &#61;&#61; "c")                     {                         fs.Brandid &#61; brandid;                         fs.Companyid &#61; int.Parse(id);                         db.FourSunion.AddObject(fs);                         db.SaveChanges();                     }                 }                                jsHint.toUrl("修改成功!", "fourS.aspx?page&#61;" &#43; Request.QueryString["page"]);             }             catch (Exception)             {                 jsHint.toUrl("修改失败!", "fourS.aspx?page&#61;" &#43; Request.QueryString["page"]);             }         }     } }


转:https://www.cnblogs.com/ft-Pavilion/p/4634997.html



推荐阅读
  • 解决Bootstrap DataTable Ajax请求重复问题
    在最近的一个项目中,我们使用了JQuery DataTable进行数据展示,虽然使用起来非常方便,但在测试过程中发现了一个问题:当查询条件改变时,有时查询结果的数据不正确。通过FireBug调试发现,点击搜索按钮时,会发送两次Ajax请求,一次是原条件的请求,一次是新条件的请求。 ... [详细]
  • 在JavaWeb开发中,文件上传是一个常见的需求。无论是通过表单还是其他方式上传文件,都必须使用POST请求。前端部分通常采用HTML表单来实现文件选择和提交功能。后端则利用Apache Commons FileUpload库来处理上传的文件,该库提供了强大的文件解析和存储能力,能够高效地处理各种文件类型。此外,为了提高系统的安全性和稳定性,还需要对上传文件的大小、格式等进行严格的校验和限制。 ... [详细]
  • MySQL Decimal 类型的最大值解析及其在数据处理中的应用艺术
    在关系型数据库中,表的设计与SQL语句的编写对性能的影响至关重要,甚至可占到90%以上。本文将重点探讨MySQL中Decimal类型的最大值及其在数据处理中的应用技巧,通过实例分析和优化建议,帮助读者深入理解并掌握这一重要知识点。 ... [详细]
  • 在PHP中如何正确调用JavaScript变量及定义PHP变量的方法详解 ... [详细]
  • 技术分享:使用 Flask、AngularJS 和 Jinja2 构建高效前后端交互系统
    技术分享:使用 Flask、AngularJS 和 Jinja2 构建高效前后端交互系统 ... [详细]
  • 【实例简介】本文详细介绍了如何在PHP中实现微信支付的退款功能,并提供了订单创建类的完整代码及调用示例。在配置过程中,需确保正确设置相关参数,特别是证书路径应根据项目实际情况进行调整。为了保证系统的安全性,存放证书的目录需要设置为可读权限。值得注意的是,普通支付操作无需证书,但在执行退款操作时必须提供证书。此外,本文还对常见的错误处理和调试技巧进行了说明,帮助开发者快速定位和解决问题。 ... [详细]
  • C++ 异步编程中获取线程执行结果的方法与技巧及其在前端开发中的应用探讨
    本文探讨了C++异步编程中获取线程执行结果的方法与技巧,并深入分析了这些技术在前端开发中的应用。通过对比不同的异步编程模型,本文详细介绍了如何高效地处理多线程任务,确保程序的稳定性和性能。同时,文章还结合实际案例,展示了这些方法在前端异步编程中的具体实现和优化策略。 ... [详细]
  • 本文探讨了如何利用 jQuery 的 JSONP 技术实现跨域调用外部 Web 服务。通过详细解析 JSONP 的工作原理及其在 jQuery 中的应用,本文提供了实用的代码示例和最佳实践,帮助开发者解决跨域请求中的常见问题。 ... [详细]
  • 本文总结了JavaScript的核心知识点和实用技巧,涵盖了变量声明、DOM操作、事件处理等重要方面。例如,通过`event.srcElement`获取触发事件的元素,并使用`alert`显示其HTML结构;利用`innerText`和`innerHTML`属性分别设置和获取文本内容及HTML内容。此外,还介绍了如何在表单中动态生成和操作``元素,以便更好地处理用户输入。这些技巧对于提升前端开发效率和代码质量具有重要意义。 ... [详细]
  • Ihavetwomethodsofgeneratingmdistinctrandomnumbersintherange[0..n-1]我有两种方法在范围[0.n-1]中生 ... [详细]
  • 网站访问全流程解析
    本文详细介绍了从用户在浏览器中输入一个域名(如www.yy.com)到页面完全展示的整个过程,包括DNS解析、TCP连接、请求响应等多个步骤。 ... [详细]
  • 本地存储组件实现对IE低版本浏览器的兼容性支持 ... [详细]
  • 本文介绍了如何使用 Node.js 和 Express(4.x 及以上版本)构建高效的文件上传功能。通过引入 `multer` 中间件,可以轻松实现文件上传。首先,需要通过 `npm install multer` 安装该中间件。接着,在 Express 应用中配置 `multer`,以处理多部分表单数据。本文详细讲解了 `multer` 的基本用法和高级配置,帮助开发者快速搭建稳定可靠的文件上传服务。 ... [详细]
  • 深入探索HTTP协议的学习与实践
    在初次访问某个网站时,由于本地没有缓存,服务器会返回一个200状态码的响应,并在响应头中设置Etag和Last-Modified等缓存控制字段。这些字段用于后续请求时验证资源是否已更新,从而提高页面加载速度和减少带宽消耗。本文将深入探讨HTTP缓存机制及其在实际应用中的优化策略,帮助读者更好地理解和运用HTTP协议。 ... [详细]
  • JavaScript XML操作实用工具类:XmlUtilsJS技巧与应用 ... [详细]
author-avatar
rgx-秀_550
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有