jqeury eval ×Ö·û´® ת»»json
$.ajax({ type: "post", contentType: "application/json", url: "../WebForm1.aspx/GetRightsStr", dataType: "json", success: function (msg) { alert(msg.d); var data = eval("(" + msg.d + ")"); $.each(data.rights, function (index, item) { alert(item.RightsName); }); }, error: function (e, s, d) { alert(e); alert(s); alert(d); } }); ºǫ́·½·¨£º/// <summary> /// DataTableת³ÉJson /// </summary> /// <param name="jsonName">josnÃû³Æ</param> /// <param name="dt">Ҫת»»µÄÊý¾Ý¼¯</param> /// <returns></returns> public static string DataTableToJson(string jsonName, DataTable dt) { StringBuilder Json = new StringBuilder(); Json.Append("{\"" + jsonName + "\":["); if (dt.Rows.Count > 0) { for (int i = 0; i < dt.Rows.Count; i++) { Json.Append("{"); for (int j = 0; j < dt.Columns.Count; j++) { Json.Append("\"" + dt.Columns[j].ColumnName.ToString() + "\":\"" + dt.Rows[i][j].ToString() + "\""); if (j < dt.Columns.Count - 1) { Json.Append(","); } } Json.Append("}"); if (i < dt.Rows.Count - 1) { Json.Append(","); } } } Json.Append("]}"); return Json.ToString(); }
Õâ¸ö·½·¨ÊÇÒ»¸ö½«DataTableת»»³É×Ö·û´®µÄ·½·¨ ¡£½ñÌìÓöµ½µÄÎÊÌâÊÇ ÔÚ var data = eval("(" + msg.d + ")");
³ö´íÎó Ìáʾ ÊÇ È±ÉÙ } Õâ¸ö·½·¨ÓÐÓÃÁ˺ܶà´ÎÁË ²»ÖªµÀΪʲô³öÏÖÕâÑùµÄ´íÎó ¡£
ÕÒÁË°ëÌ죬²Å·¢ÏÖ ÊÇÊý¾ÝµÄÎÊÌâ ÔÚ·µ»ØµÄ×Ö·û´®Àï ÓÐ "\"Õâ¸ö×Ö·û£¬ "\"¾ßÓÐתÒåµÄ×÷ÓÃ
ËùÓлá³öÏÖÕâ¸ö´íÎó£¬Ôΰ¡£¬Õæʵº¦¿àÎÒÁË £¬Ï£Íû´ó¼Ò²»ÒªÏñÎÒÕâÑùºýÍ¿¡£
ÍƼöÐÅÏ¢
- jqueryʵÏÖÍøվͼƬÀÁ¼ÓÔØ´úÂë
- jQuery Tooltips²å¼þ
- jQueryµÄ.bind()¡¢.live()ºÍ.delegate(....
- [Ô´´]·ÂGoogle Reader¡¢ÐÂÀË΢²©¡¢ÌÚѶ΢²©µ....
- Ä㲻ϲ»¶»ðºü£¬µ«ÓÖϲ»¶firebug£¬ÄǾ͸úÎÒÒ»ÆðÀ´ÔÚIEÉÏ....
- ¸ù¾ÝÏÔʾÆ÷·Ö±æÂʵ÷ÕûÒ³ÃæÏÔʾµÄJavascript½Å±¾
- jQuery дµÄ·ÂÐÂÀË΢²© ÏòϹö¶¯Ð§¹û¡¾×ªÔØ¡¿
- ͨÓõÄJqueryÑ¡ÔñÆ÷
- jQuery ½áºÏ Json Ìá½»Êý¾Ýµ½Webservice£¬....
- ×ÔÖÆjQueryÖÇÄÜÌáʾ²å¼þһö
ÈÈÃÅÐÅÏ¢
- nohup: redirecting stderr to stdou....
- ʹÓÃlog_formatΪNginx·þÎñÆ÷ÉèÖøüÏêϸµÄÈÕÖ¾¸ñʽ
- jquery easyUI--dataGrid-Json
- [Ô´´]·ÂGoogle Reader¡¢ÐÂÀË΢²©¡¢ÌÚѶ΢²©µ....
- ÀûÓÃKeepalived+mysql¹¹½¨¸ß¿ÉÓÃMySQLË«Ö÷×Ô¶....
- Nginx+keepalivedʵÏÖ¸ºÔؾùºâºÍË«»úÈȱ¸¸ß¿ÉÓÃ
- jqueryʵÏÖÒ³Ãæ¼ÓÔؽø¶ÈÌõ
- Rolling cURL: PHP²¢·¢×î¼Ñʵ¼ù
- codeigniter ·ÓÉÖÕ¼«ÓÅ»¯(url rewrite)
- linuxÏÂÉèÖÃsshÎÞÃÜÂëµÇ¼
×î½ü¸üÐÂ
- js»ñÈ¡srcÖд«µÝµÄ²ÎÊý
- jqueryʵÏÖÍøվͼƬÀÁ¼ÓÔØ´úÂë
- ÈÃä¯ÀÀÆ÷ÆÁ±ÎµôJavaScriptµÄ³ö´íÌáʾ
- github²»ÄܼÓÔØcss¡¢js½â¾ö°ì·¨
- ÎÒÖªµÀµÄJavaScript -- Éè¼Æģʽ(ÇŽÓ)Ó¦ÓÃÖ® ¨C ....
- 15¸öÖµµÃ¿ª·¢ÈËÔ±¹Ø×¢µÄjQuery¿ª·¢¼¼ÇɺÍÐĵÃ
- dz̸JavascriptÃæÏò¶ÔÏó±à³Ì
- JS¼òµ¥¶¯»·â×°
- JavaScript³õѧÕßӦעÒâµÄÆ߸öϸ½Ú
- jQuery Tooltips²å¼þ
ÆÀÂÛ