JavaScript ½âÎö JSON Êý¾Ý
JSON £¨JavaScript Object Notation£©Ò»ÖÖ¼òµ¥µÄÊý¾Ý¸ñʽ£¬±Èxml¸üÇáÇÉ¡£ JSON ÊÇ JavaScript ÔÉú¸ñʽ£¬ÕâÒâζ×ÅÔÚ JavaScript Öд¦Àí JSON Êý¾Ý²»ÐèÒªÈκÎÌØÊâµÄ API »ò¹¤¾ß°ü¡£
JSONµÄ¹æÔòºÜ¼òµ¥£º ¶ÔÏóÊÇÒ»¸öÎÞÐòµÄ“‘Ãû³Æ/Öµ’¶Ô”¼¯ºÏ¡£Ò»¸ö¶ÔÏóÒÔ“{”£¨×óÀ¨ºÅ£©¿ªÊ¼£¬“}”£¨ÓÒÀ¨ºÅ£©½áÊø¡£Ã¿¸ö“Ãû³Æ”ºó¸úÒ»¸ö“:”£¨Ã°ºÅ£©£»“‘Ãû³Æ/Öµ’ ¶Ô”Ö®¼äʹÓÓ,”£¨¶ººÅ£©·Ö¸ô¡£¾ßÌåϸ½Ú²Î¿¼http://www.json.org/json-zh.html
¾Ù¸ö¼òµ¥µÄÀý×Ó£º
js ´úÂë
function showJSON() {
var user =
{
"username":"andy",
"age":20,
"info": { "tel": "123456", "cellphone": "98765"},
"address":
[
{"city":"beijing","postcode":"222333"},
{"city":"newyork","postcode":"555666"}
]
}
alert(user.username);
alert(user.age);
alert(user.info.cellphone);
alert(user.address[0].city);
alert(user.address[0].postcode);
}
Õâ±íʾһ¸öuser¶ÔÏó£¬ÓµÓÐusername, age, info, address µÈÊôÐÔ¡£
ͬÑùÒ²¿ÉÒÔÓÃJSONÀ´¼òµ¥µÄÐÞ¸ÄÊý¾Ý£
Ïà¹ØÎĵµ£º
¶¨ÒåºÍÓ÷¨
prompt() ·½·¨ÓÃÓÚÏÔʾ¿ÉÌáʾÓû§½øÐÐÊäÈëµÄ¶Ô»°¿ò¡£
Óï·¨
prompt(text,defaultText)
²ÎÊýÃèÊö
text
¿ÉÑ¡¡£ÒªÔÚ¶Ô»°¿òÖÐÏÔʾµÄ´¿Îı¾£¨¶ø²»ÊÇ HTML ¸ñʽµÄÎı¾£©¡£
defaultText
¿ÉÑ¡¡£Ä¬ÈϵÄÊäÈëÎı¾¡£
˵Ã÷
Èç¹ûÓû§µ¥»÷Ìáʾ¿òµÄÈ¡Ïû°´Å¥£¬Ôò·µ»Ø null¡£Èç¹ûÓû§µ¥»÷È·ÈÏ°´Å¥£¬Ôò·µ»ØÊäÈë×ֶε±Ç°Ï ......
<script language="javascript">
function ShowTableRow(id)
{
var _Row = document.getElementById(id) <!-- »ñÈ¡IDΪTableRowID µÄ¶ÔÏó -->
var _Img = document.getElementById("Img"+id)
&nb ......
ÌØÊâJavaScript½Å±¾£º
1.½ûÓÃ(»Ö¸´)href³¬¼¶Á´½Ó£®
2.javascriptÖе÷ÓÃvbs¶Ô»°¿òʵÏÖConfirm,¿ÉÒÔÏÔʾYes,No,»¹Óи÷ÖÖͼ±ê£¬½öIEÏÂÓÐЧ£®
3.ÏÞÖÆÉÏ´«ÎļþÀàÐÍΪjpg.
4.ÏÞÖÆÀ뿪µ±Ç°Ò³Ã棬ÔÚÀ뿪ʱÌáʾ£®½öÏÞÖÆ´°¿Ú¹Ø±Õ»òͨ¹ýij¸öhref³¬¼¶Á´½ÓÀ뿪£®(Ò³Ãæˢк͵ØÖ·À¸¸Ä±äʱ²»Ìáʾ£©
demo.htmlÈçÏ£º
<html>
&n ......
jQuery, MooTools, Prototype µÈÓÅÐãµÄ
JavaScript ¿ò¼ÜÓµÓи÷ÖÖÇ¿´óµÄ¹¦ÄÜ£¬°üÀ¨»æÖÆ Web ͼ±í£¬Ê¹ÓÃÕâЩ¿ò¼ÜÒÔ¼°ÏàÓ¦²å¼þ£¬ÎÒÃÇ¿ÉÒԷdz£ÇáËɵØʵÏÖÇúÏßͼ£¬Ô²±ýͼ£¬Öù״ͼµÈ
Web ͼ±íµÄ»æÖÆ£¬¶ø²»±ØÏóÒÔÍùÄÇÑùͨ¹ý¸´Ô Flash ¼¼ÊõʵÏÖ¡£±¾ÎĽéÉÜÁË9¸öÓÅÐãµÄ»ùÓÚ JavaScript Óë CSS& ......
ǰ̨£º
<%@ Page AutoEventWireup="true" CodeBehind="CustomerBizList.aspx.cs" Inherits="SSMIS.UI.MISUI.CustomerBizList"
Language="C#" MasterPageFile="/Master/WebAdmin.master" %>
<asp:Content ID="Content1" runat="Server" ContentPlaceHolderID="bcr">
......