锘??xml version="1.0" encoding="utf-8" standalone="yes"?> 涓撴敞浜庡垎浜獼ava鍚庣鐩稿叧鎶鏈佽佸徃鏈哄疄鎴樺共璐э紝涓嶉檺浜嶫VM銆佸茍鍙戙佽璁℃ā寮忋佹ц兘浼樺寲銆佸垎甯冨紡&寰湇鍔°佷簯鍘熺敓銆佸ぇ鏁版嵁鐩稿叧涓婚銆?/span> Deserializes JavaScript Object Notation (JSON) text to produce a JavaScript value. Required. Valid JSON text. Optional. A function that filters and transforms the results. The deserialized object is traversed recursively, and the reviver function is called for each member of the object in post-order (every object is revived after all its members have been revived). For each member, the following occurs: If reviver returns a valid value, the member value is replaced with the value returned by reviver. If reviver returns what it received, the structure is not modified. If reviver returns null or undefined, the object member is deleted. The reviver argument is often used to transform JSON representation of International Organization for Standardization (ISO) date strings into Coordinated Universal Time (UTC) format Date objects. Exception Condition JavaScript parser errors The input text does not comply with JSON syntax. To correct the error, do one of the following: Modify the text argument to comply with JSON syntax. For more information, see the BNF syntax notation of JSON objects. Make sure that the text argument was serialized by a JSON-compliant implementation, such as, JSON.stringify. This example uses JSON.parse to deserialize JSON text into the contact object. This example uses JSON.parse to deserialize an ISO-formatted date string. The dateReviver function returns Date objects for members that are formatted like ISO date strings. Supported in the following document modes: Internet Explorer 8 standards, Internet Explorer 9 standards. See Version Information. Not supported in the following document modes: Quirks, Internet Explorer 6 standards, Internet Explorer 7 standards. Serializes a JavaScript value into JavaScript Object Notation (JSON) text. Required. A JavaScript value, usually an object or array, to be serialized. Optional. A function or array that filters and transforms the results. If replacer is a function, JSON.stringify calls the function, passing in the key and value of each member. The return value is serialized instead of the original value. If the function returns undefined, the member will be excluded from the serialization. The key for the root object is an empty string: "". If replacer is an array, only members with key values in the array will be serialized. The order of serialization is the same as the order of the keys in the array. Thereplacer array is ignored when the value argument is also an array. Optional. Adds indentation, white space, and line break characters to the return-value JSON text to make it easier to read. If space is omitted, the return-value text is generated without any extra white space. If space is a number, the return-value text is indented with the specified number of white spaces at each level. If space is greater than 10, text is indented 10 spaces. If space is a non-empty string, such as '\t', the return-value text is indented with the characters in the string at each level. If space is a string that is longer than 10 characters, the first 10 characters are used. If the value that is being serialized has a toJSON method, the JSON.stringify function calls the toJSON method and uses the return value for serialization. If the return value of the toJSON method is undefined, the member will not be serialized. This enables an object to determine its own JSON representation. Values that do not have JSON representations, such as undefined, will not be serialized. In objects, they will be dropped. In arrays, they will be replaced with null. String values begin and end with a quotation mark. All Unicode characters may be enclosed in the quotation marks except for the characters that must be escaped by using a backslash. The following characters must be preceded by a backslash: Quotation mark (") Backslash (\) Backspace (b) Formfeed (f) Newline (n) Carriage return (r) Horizontal tab (t) Four-hexadecimal-digits (uhhhh) During the serialization process, if a toJSON method exists for the value argument, JSON.stringify first calls the toJSON method. If it does not exist, the original value is used. Next, if a replacer argument is provided, the value (original value or toJSON return-value) is replaced with the return-value of the replacer argument. Finally, white spaces are added to the value based on the optional space argument to generate the final serialized JSON text. This example uses JSON.stringify to serialize the contact object to JSON text. The memberfilter array is defined so that only the surname and phone members are serialized. The firstname member is omitted. This example uses JSON.stringify to serialize an array. The replaceToUpper function converts every string in the array to uppercase. This example uses the toJSON method to serialize string member values in uppercase. Supported in the following document modes: Internet Explorer 8 standards, Internet Explorer 9 standards. See Version Information. Not supported in the following document modes: Quirks, Internet Explorer 6 standards, Internet Explorer 7 standards. <script type="text/javascript"> $("#ddlProvince").empty(); //娓呯┖鐪佷喚SELECT鎺т歡 $.getJSON("/ajax/GetProvinceList", function(data) { } function GetCity() { $("#ddlCity").empty(); //娓呯┖鍩庡競SELECT鎺т歡 function GetDistrict() { </script> 涓嬮潰榪欐html浠g爜鏄湪struts2鐨勪笅鎷夋爣絳句腑鍔犲叆浜唖pan鏍囩錛屽湪欏甸潰瑁呰澆鐨勬椂鍊欏氨璁╀笅鎷夋鍙樻垚涓嶅彲璇匯?/p>
<body onload="init()"> <span id="id_select"> </body> 濡備笅鏄痡s浠g爜錛屽湪init鏂規硶涓皟鐢╯electReadOnly璁╀笅鎷夋鍙樻垚鍙銆?/p>
/*鏍規嵁欏甸潰涓妔pan鐨刬d璁劇疆select涓哄彧璇?/strong>/ function selectReadOnly(selectedId){ function init(){
Java鐖卞ソ鑰呯ぞ鍖?/strong>
鍏紬鍙峰唴瀹圭畝浠嬶細
甯屾湜鍏蟲敞鐨勪綘鍋滀笅鑴氭錛屽畾鏈夋墍鏀惰幏銆?/span>
浠ュ墠鐨勪釜浜哄崥瀹㈠唴瀹逛笉濂借縼縐伙紝鎵浠ユ垜鎵撶畻鏍規嵁鑷繁鐨勫騫寸粡楠岋紝涓嶆柇鏁寸悊杈撳嚭鏈変環鍊肩殑鍐呭銆?br />鐩墠鍏紬鍙峰唴瀹規湁鍏充簬SpringCloud錛堝井鏈嶅姟妗嗘灦錛夈丼kywalking錛圓PM鐩戞帶璋冪敤閾撅級銆丣VM錛圙C鍒嗘瀽銆佸唴瀛樻硠婕忓垎鏋愶級銆佸茍鍙戠紪紼?/span>鐩稿叧鍘熷垱瀹炴垬鏂囩珷宸插嚭鐐夈?br />
鏈榪戝垰寮濮嬪凡緇忔湁涓嶅皯灝忎紮浼村叧娉ㄤ簡錛屾湡寰呰兘鏈夊垢鎼滅儲鍒版湰鍗氬鐨勫悓瀛︼紝鍙互鎵爜鍏蟲敞涓涓嬶紝涓嶈儨鎰熸縺銆?br />澶у鏈変換浣曟妧鏈佽亴鍦恒侀潰璇曚笂鐨勯棶棰橀兘鍙互涓庢垜浜ゆ祦銆?br />
鏂瑰紡涓錛?/strong>鎵爜浠ヤ笅鍏紬鍙蜂簩緇寸爜錛?/strong>
鏂瑰紡浜岋細鍦ㄥ井淇′笂鐩存帴鎼滅儲錛?nbsp;javatech_cbo
鎰熻阿鍚勪綅灝忎紮浼寸殑鏀寔錛屽悗緇細鍦ㄨ鍏紬鍙蜂笂杈撳嚭澶ч噺鐨勬湁浠峰肩殑瀹炴垬騫茶揣 錛屾湡寰呬笌浣犱竴鍚岃繘姝ヤ笌鎴愰暱銆?br />
]]>JSON.parse(text [, reviver])
var jsontext = '{"firstname":"Jesper","surname":"Aaberg","phone":["555-0100","555-0120"]}'; var contact = JSON.parse(jsontext); var fullname = contact.surname + ", " + contact.firstname; // The value of fullname is "Aaberg, Jesper"
var jsontext = '{ "hiredate": "2008-01-01T12:00:00Z", "birthdate": "2008-12-25T12:00:00Z" }'; var dates = JSON.parse(jsontext, dateReviver); var string = dates.birthdate.toUTCString(); // The value of string is "Thu, 25 Dec 2008 12:00:00 UTC" function dateReviver(key, value) { var a; if (typeof value === 'string') { a = /^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2}(?:\.\d*)?)Z$/.exec(value); if (a) { return new Date(Date.UTC(+a[1], +a[2] - 1, +a[3], +a[4], +a[5], +a[6])); } } return value; };
JSON.stringify(value [, replacer] [, space])
Order of Execution
var contact = new Object(); contact.firstname = "Jesper"; contact.surname = "Aaberg"; contact.phone = ["555-0100", "555-0120"]; var memberfilter = new Array(); memberfilter[0] = "surname"; memberfilter[1] = "phone"; var jsonText = JSON.stringify(contact, memberfilter, "\t"); /* The value of jsonText is: '{ "surname": "Aaberg", "phone": [ "555-0100", "555-0120" ] }' */
var continents = new Array(); continents[0] = "Europe"; continents[1] = "Asia"; continents[2] = "Australia"; continents[3] = "Antarctica"; continents[4] = "North America"; continents[5] = "South America"; continents[6] = "Africa"; var jsonText = JSON.stringify(continents, replaceToUpper); /* The value of jsonText is: '"EUROPE,ASIA,AUSTRALIA,ANTARCTICA,NORTH AMERICA,SOUTH AMERICA,AFRICA"' */ function replaceToUpper(key, value) { return value.toString().toUpperCase(); }
var contact = new Object(); contact.firstname = "Jesper"; contact.surname = "Aaberg"; contact.phone = ["555-0100", "555-0120"]; contact.toJSON = function(key) { var replacement = new Object(); for (var val in this) { if (typeof (this[val]) === 'string') replacement[val] = this[val].toUpperCase(); else replacement[val] = this[val] } return replacement; }; var jsonText = JSON.stringify(contact); /* The value of jsonText is: '{"firstname":"JESPER","surname":"AABERG","phone":["555-0100","555-0120"]}' */
]]>
鎬葷粨榪樹笉閿欑殑
$(document).ready(function() {
GetByJquery();
$("#ddlProvince").change(function() { GetCity() });
$("#ddlCity").change(function() { GetDistrict() });
});
function GetByJquery() {
$.each(data, function(i, item) {
$("<option></option>")
.val(item["ProvinceID"])
.text(item["ProvinceName"])
.appendTo($("#ddlProvince"));
});
GetCity();
});
var url ="/ajax/GetCityList/" + $("#ddlProvince").val();
$.getJSON(url, function(data) {
$.each(data, function(i, item) {
$("<option></option>")
.val(item["CityID"])
.text(item["CityName"])
.appendTo($("#ddlCity"));
});
GetDistrict();
});
}
$("#ddlDistrict").empty(); //娓呯┖甯傚尯SELECT鎺т歡
var url = "/ajax/GetDistrictList/" + $("#ddlCity").val();
$.getJSON(url, function(data) {
$.each(data, function(i, item) {
$("<option></option>")
.val(item["DistrictID"])
.text(item["DistrictName"])
.appendTo($("#ddlDistrict"));
});
});
}
]]>
return false;
if(this.substring(this.length-str.length)==str) return true;
else return false;
return true;
}
]]>
鍦ㄩ」鐩紑鍙戣繃紼嬩腑鎴戜滑鏃跺父浼氱鍒拌璁劇疆涓嬫媺妗嗕負鍙錛坮eadonly錛夛紝浣嗘槸鍙儨鐨勬槸select娌℃湁鍙灞炴э紝鎵浠ラ渶瑕佸湪select澶栭潰鍖呭惈涓涓?span style="color: #ff0000">span錛岄氳繃js鏉ユ敼鍙樸?/p>
<s:select name="sjdwmc" list="sjdxdwList" listKey="dxbh" listValue="dwmc" headerKey="" headerValue=""></s:select>
</span>
var obj = document.getElementById(selectedId);
obj.onmouseover = function(){
obj.setCapture();
}
obj.onmouseout = function(){
obj.releaseCapture();
}
obj.onfocus = function(){
obj.blur();
}
obj.onbeforeactivate = function(){
return false;
}
}
selectReadOnly("id_select");
}
]]>
<script language="JavaScript" type="text/javascript">
<!--
calendar = new Date(); //寰楀埌褰撳墠鏃ユ湡
day = calendar.getDay(); //褰撳墠澶氭暟鍙?
month = calendar.getMonth(); //褰撳墠鏈堜喚
date = calendar.getDate(); //褰撳墠鏄熸湡
year = calendar.getYear(); //騫翠喚
if (year< 100) year = 1900 + year;
cent = parseInt(year/100);
g = year % 19;
k = parseInt((cent - 17)/25);
i = (cent - parseInt(cent/4) - parseInt((cent - k)/3) + 19*g + 15) % 30;
i = i - parseInt(i/28)*(1 - parseInt(i/28)*parseInt(29/(i+1))*parseInt((21-g)/11));
j = (year + parseInt(year/4) + i + 2 - cent + parseInt(cent/4)) % 7;
l = i - j;
emonth = 3 + parseInt((l + 40)/44);
edate = l + 28 - 31*parseInt((emonth/4));
emonth--;
var dayname = new Array ("鏄熸湡鏃?, "鏄熸湡涓", "鏄熸湡浜?, "鏄熸湡涓?, "鏄熸湡鍥?, "鏄熸湡浜?, "鏄熸湡鍏?);
var monthname =
new Array ("1鏈?,"2鏈?,"3鏈?,"4鏈?,"5鏈?,"6鏈?,"7鏈?,"8鏈?,"9鏈?,"10鏈?,"11鏈?,"12鏈? );
document.write(year +"騫?);
document.write(monthname[month]);
document.write(date + "鏃?+" ");
document.write(dayname[day]);
//-->
</script>
js鏃ユ湡鐩稿叧
var myDate = new Date();
myDate.getYear(); //鑾峰彇褰撳墠騫翠喚(2浣?
myDate.getFullYear(); //鑾峰彇瀹屾暣鐨勫勾浠?4浣?1970-????)
myDate.getMonth(); //鑾峰彇褰撳墠鏈堜喚(0-11,0浠h〃1鏈?
myDate.getDate(); //鑾峰彇褰撳墠鏃?1-31)
myDate.getDay(); //鑾峰彇褰撳墠鏄熸湡X(0-6,0浠h〃鏄熸湡澶?
myDate.getTime(); //鑾峰彇褰撳墠鏃墮棿(浠?970.1.1寮濮嬬殑姣鏁?
myDate.getHours(); //鑾峰彇褰撳墠灝忔椂鏁?0-23)
myDate.getMinutes(); //鑾峰彇褰撳墠鍒嗛挓鏁?0-59)
myDate.getSeconds(); //鑾峰彇褰撳墠縐掓暟(0-59)
myDate.getMilliseconds(); //鑾峰彇褰撳墠姣鏁?0-999)
myDate.toLocaleDateString(); //鑾峰彇褰撳墠鏃ユ湡
var mytime=myDate.toLocaleTimeString(); //鑾峰彇褰撳墠鏃墮棿
myDate.toLocaleString( ); //鑾峰彇鏃ユ湡涓庢椂闂?/ca>
<SCRIPT LANGUAGE="JavaScript">
<!--
var now= new Date();
var year=now.getYear();
var month=now.getMonth()+1;
var day=now.getDate();
var hour=now.getHours();
var minute=now.getMinutes();
var second=now.getSeconds();
alert(year+"-"+month+"-"+day+" "+hour+":"+minute+":"+second);
-->
</SCRIPT>
now.getMilliseconds(); //鑾峰彇褰撳墠姣鏁?0-999)
鍩烘湰浠嬬粛錛?br />
showModalDialog() (IE 4+ 鏀寔)
showModelessDialog() (IE 5+ 鏀寔)
window.showModalDialog() 鏂規硶鐢ㄦ潵鍒涘緩涓涓樉紺篐TML鍐呭鐨勬ā鎬佸璇濇銆?br />
window.showModelessDialog() 鏂規硶鐢ㄦ潵鍒涘緩涓涓樉紺篐TML鍐呭鐨勯潪妯℃佸璇濇銆?br />
浣跨敤鏂規硶錛?br />
vReturnValue = window.showModalDialog(sURL [, vArguments] [,sFeatures])
vReturnValue = window.showModelessDialog(sURL [, vArguments] [,sFeatures])
鍙傛暟璇存槑錛?br />
sURL -- 蹇呴夊弬鏁幫紝綾誨瀷錛氬瓧絎︿覆銆傜敤鏉ユ寚瀹氬璇濇瑕佹樉紺虹殑鏂囨。鐨刄RL銆?br />
vArguments -- 鍙夊弬鏁幫紝綾誨瀷錛氬彉浣撱傜敤鏉ュ悜瀵硅瘽妗嗕紶閫掑弬鏁般備紶閫掔殑鍙傛暟綾誨瀷涓嶉檺錛屽寘鎷暟緇勭瓑銆傚璇濇閫氳繃window.dialogArguments鏉ュ彇寰椾紶閫掕繘鏉ョ殑鍙傛暟銆?br />
sFeatures -- 鍙夊弬鏁幫紝綾誨瀷錛氬瓧絎︿覆銆傜敤鏉ユ弿榪板璇濇鐨勫瑙傜瓑淇℃伅錛屽彲浠ヤ嬌鐢ㄤ互涓嬬殑涓涓垨鍑犱釜錛岀敤鍒嗗彿“;”闅斿紑銆?br />
----------------
1. dialogHeight: 瀵硅瘽妗嗛珮搴︼紝涓嶅皬浜?00px
2. dialogWidth: 瀵硅瘽妗嗗搴︺?br />
3. dialogLeft: 紱誨睆騫曞乏鐨勮窛紱匯?br />
4. dialogTop: 紱誨睆騫曚笂鐨勮窛紱匯?br />
5. center: { yes | no | 1 | 0 } 錛?nbsp; 鏄惁灞呬腑錛岄粯璁es錛屼絾浠嶅彲浠ユ寚瀹氶珮搴﹀拰瀹藉害銆?br />
6. help: {yes | no | 1 | 0 }錛?nbsp; 鏄惁鏄劇ず甯姪鎸夐挳錛岄粯璁es銆?br />
7. resizable: {yes | no | 1 | 0 } [IE5+]錛?nbsp; 鏄惁鍙鏀瑰彉澶у皬銆傞粯璁o銆?br />
8. status: {yes | no | 1 | 0 } [IE5+]錛?nbsp; 鏄惁鏄劇ず鐘舵佹爮銆傞粯璁や負yes[ Modeless]鎴杗o[Modal]銆?br />
9. scroll: { yes | no | 1 | 0 | on | off }錛氭槸鍚︽樉紺烘粴鍔ㄦ潯銆傞粯璁や負yes銆?br />
涓嬮潰鍑犱釜灞炴ф槸鐢ㄥ湪HTA涓殑錛屽湪涓鑸殑緗戦〉涓竴鑸笉浣跨敤銆?br />
10. dialogHide:{ yes | no | 1 | 0 | on | off }錛氬湪鎵撳嵃鎴栬呮墦鍗伴瑙堟椂瀵硅瘽妗嗘槸鍚﹂殣钘忋傞粯璁や負no銆?br />
11. edge:{ sunken | raised }錛氭寚鏄庡璇濇鐨勮竟妗嗘牱寮忋傞粯璁や負raised銆?br />
12. unadorned:{ yes | no | 1 | 0 | on | off }錛氶粯璁や負no銆?br />
鍙傛暟浼犻掞細
1. 瑕佹兂瀵硅瘽妗嗕紶閫掑弬鏁幫紝鏄氳繃vArguments鏉ヨ繘琛屼紶閫掔殑銆傜被鍨嬩笉闄愬埗錛屽浜庡瓧絎︿覆綾誨瀷錛屾渶澶т負4096涓瓧絎︺備篃鍙互浼犻掑璞★紝渚嬪錛?br />
-------------------------------
parent.htm
<script>
var obj = new Object();
obj.name="51js";
window.showModalDialog("modal.htm",obj,"dialogWidth=200px;dialogHeight=100px");
</script>
modal.htm
<script>
var obj = window.dialogArguments
alert("鎮ㄤ紶閫掔殑鍙傛暟涓猴細" + obj.name)
</script>
-------------------------------
2. 鍙互閫氳繃window.returnValue鍚戞墦寮瀵硅瘽妗嗙殑紿楀彛榪斿洖淇℃伅錛屽綋鐒朵篃鍙互鏄璞°備緥濡傦細
------------------------------
parent.htm
<script>
str =window.showModalDialog("modal.htm",,"dialogWidth=200px;dialogHeight=100px");
alert(str);
</script>
modal.htm
<script>
window.returnValue="http://homepage.yesky.com";