62,041
社区成员
发帖
与我相关
我的任务
分享
public void ProcessRequest(HttpContext context)
{
context.Response.ContentType = "text/plain";
if (!string.IsNullOrEmpty(context.Request.QueryString["name"]))
{
string name = context.Request.QueryString["name"];
System.Xml.XmlDocument xml = new System.Xml.XmlDocument();
xml.Load(context.Server.MapPath("1.xml"));
System.Xml.XmlNodeList list = xml.SelectNodes("//files[@name='" + name + "']/key");
foreach (System.Xml.XmlNode n in list)
n.Attributes["value"].Value = "1";
xml.Save(context.Server.MapPath("1.xml"));
context.Response.Write("true");
context.Response.End();
}
}
<script type="text/javascript" src="js/jquery-1.3.2.min.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$.ajax({
url:"Handler.ashx",
type:"get",
data:"name=filses",
success:function(result){
alert(result);
}
})
})
</script>
$.getScript("jquery.xmlext.js", function() {
var xd = $.parseXml("<items><center /></items>");
var x = $(xd);
x.find("center").appendXml("<bottom />").prependXml("<top />");
x.find("top,bottom").afterXml("<After />").beforeXml("<Before />");
alert(x.xml());
var obj = { Name: "Darkthread", Score: 100 };
xd = $.toXml(obj, "Person");
alert($(xd).xml());
xd = $.toXml(obj, "Person", true);
alert($(xd).xml());
});