javascript, json, xml
¡¾×ª×Ô¡¿http://www.cnblogs.com/chenxizhang/archive/2010/01/13/1646255.html
ÔÚÍøÂç±à³ÌÖУ¬ÎÒÃǾ³£ÐèÒªÓõ½javascript,ÕâЩ¿Í»§¶Ë½Å±¾ÓÖ¾³£ÐèÒªÓë·þÎñ¶Ë½øÐÐÒì²½µÄͨѶ£¬Ìá½»²¢½ÓÊÕÊý¾Ý¡£ÏÂÃæÕâ¸öÀý×ÓÑÝʾÁËÈçºÎÉè¼Æ·þÎñ£¬ÈçºÎ±àд½Å±¾
1. ·þÎñ¶Ë£¬ÕâÊÇÒ»¸öashxÎļþ
ÐèÒªÌí¼ÓÁ½¸öÒýÓà System.Runtime.SerializationºÍSystem.ServiceModel.Web
using System.Web;
using System.Web.Services;
using System.Runtime.Serialization.Json;
using System.Runtime.Serialization;
using System.IO;
using System.Text;
namespace DynamicTableSample
{
/// <summary>
/// $codebehindclassname$ µÄժҪ˵Ã÷
/// </summary>
[WebService(Namespace = "http://tempuri.org/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
public class Test : IHttpHandler
{
public void ProcessRequest(HttpContext context)
{
//½âÎö¿Í»§¶Ë´«¹ýÀ´µÄÊý¾Ý
var c = context.Request["data"];
var ser = new DataContractJsonSerializer(typeof(Customer));
Customer customer =ser.ReadObject(new MemoryStream(Encoding.UTF8.GetBytes(c))) as Customer;//·´ÐòÁл¯£¬½«×Ö·û´®×ª»»Îª¶ÔÏó
//·µ»Ø½á¹û
ActionResult result = new ActionResult() { ResultCode = 200, Message = "¸Ã²Ù×÷ÒѾ³É¹¦" };
var ser2 = new DataContractSerializer(typeof(ActionResult));
//Ö±½Ó·µ»Øxml¸ñʽµÄÄÚÈÝ¡£·µ»ØxmlÆäʵÊǸüºÃµÄ£¬ÒòΪÕâ¸ö·þÎñ²Å¸üÓÐͨÓÃÐÔ¡£
ser2.WriteObject(context.Response.OutputStream, result);
}
public bool IsReusable
{
get
{
return false;
}
}
}
public class Customer {
public string CustomerID { get; set; }
public Employee[] Employees { get; set; }
public class Employee
{
public int Id { get; set; }
public string Name { get; set; }
}
}
public class ActionResult
{
public int ResultC
Ïà¹ØÎĵµ£º
JavaScriptºËÐļ¼Êõ
http://book.jqcq.com/product/620915.html
±¾Êéͨ¹ýÐí¶à»ùÓÚWebµÄÀý×ÓչʾÁË£ºÈçºÎ¹¹½¨JavaScriptÂß¼ºÍ½«ËüÓëÏÖÓеĶÔÏó½á¹¹Á¬½Ó£¬ÈçºÎ¹¹½¨×Ô¼ºµÄ³ÌÐò¿âÒÔ¼°ÈçºÎÀûÓÃÆäËûJavaScriptÓû§±àдµÄ³ÌÐò¿â¡£
JavaScript ÍêÈ«ÊÖ²á JavaScript ÍêÈ«ÊÖ²á
http://book.jqcq.com/product/320819.html
......
function getOs(){
var OsObject = "";
if(navigator.userAgent.indexOf("MSIE")>0) {
return "MSIE";
}
if(isFirefox=navigator.userAgent.indexOf("Firefox")>0){
&n ......
JavaScriptÖеÄWindow´°¿Ú¶ÔÏó
ËûÊÇJavaScriptÖÐ×î´óµÄ¶ÔÏó£¬ËüÃèÊöµÄÊÇÒ»¸öä¯ÀÀÆ÷´°¿Ú¡£Ò»°ãÒªÒýÓÃËüµÄÊôÐԺͷ½·¨Ê±£¬²»ÐèÒªÓÓwindow.xxx”ÕâÖÖÐÎʽ£¬¶øÖ±½ÓʹÓÓxxx”¡£Ò»¸ö¿ò¼ÜÒ³ÃæÒ²ÊÇÒ»¸ö´°¿Ú¡£
Window´°¿Ú¶ÔÏóÓÐÈçÏÂÊôÐÔ£º
name ´°¿ÚµÄÃû³Æ£¬ÓÉ´ò¿ªËüµÄÁ¬½Ó£¨<a target="..." ......
write by ¾ÅÌìÑãôá(JTianLing) -- blog.csdn.net/vagrxie
ÌÖÂÛÐÂÎÅ×é¼°Îļþ
ÔÎÄÀ´×Ô£º¡¶JavaScript for C & Python programmers
¡·£¬¾¹ý×÷ÕßCanisÔÊÐíºó·Ò룬¼´Ê¹×ªÔØÇ븽´ø´ËÁ´½Ó¡£
ǰÑÔ£ººÜÉٸɷÒëµÄÊÂÇ飬ÀÛ£¬ÐÁ¿à£¬²»ÄÜ·¢»Ó£¬µäÐ͵ķÑÁ¦²»Ìֺã¬×î½üÎÞÁÄ£¬ÏëÔÚÍøÒ³ÉÏÏÔʾ¶¯»£¨ÒòΪCSDNÌ ......