Javascript¶¯Ì¬Éú³ÉÏÂÀÁбí
ÓÃJavascriptʵÏÖ¸ù¾ÝÏÂÀÁбícategoryµÄÑ¡Ôñ½á¹û£¬¸Ä±äÏÂÀÁбísub_categoryµÄÑ¡Ïî
<mce:script language="javascript" type="text/javascript">
<!--
function changeSubCategory() {
var sel_category = document.getElementById("category");
var sel_sub_category = document.getElementById("sub_category");
var len = sel_sub_category.length
for ( var i = 0; i < len; i++) {
sel_sub_category.remove(sel_sub_category.length - 1);
//Çå³ýÔÓеÄoption
}
if (sel_category.value == "±¾¿Æ") {
var opt1 = document.createElement("option")
opt1.text = opt1.value = "±¾¿ÆÒ»Ä꼶"
sel_sub_category.add(opt1)
var opt2 = document.createElement("option")
opt2.text = opt2.value = "±¾¿Æ¶þÄ꼶"
sel_sub_category.add(opt2)
var opt3 = document.createElement("option")
opt3.text = opt3.value = "±¾¿ÆÈýÄ꼶"
sel_sub_category.add(opt3)
var opt4 = document.createElement("option")
opt4.text = opt4.value = "±¾¿ÆËÄÄ꼶"
sel_sub_category.add(opt4)
} else if (sel_category.value == "˶ʿ") {
var opt1 = document.createElement("option")
opt1.text = opt1.value = "˶ʿһÄ꼶"
sel_sub_category.add(opt1)
var opt2 = document.createElement("option")
opt2.text = opt2.value = "˶ʿ¶þÄ꼶"
sel_sub_category.add(opt2)
} else if (sel_category.value == "²©Ê¿") {
var opt1 = document.createElement("option")
opt1.text = opt1.value = "²©Ê¿Ò»Ä꼶"
sel_sub_category.add(opt1)
var opt2 = document.createElement("option")
opt2.text = opt2.value = "²©Ê¿¶þÄ꼶"
sel_sub_category.add(opt2)
}
}
// --></mce:script>
Ïà¹ØÎĵµ£º
ÕýÔÚ¿´¡¡javascript¸ß¼¶³ÌÐòÉè¼Æ¡¡,ÆäÖйØÓÚ·Ö×éÀïÃæµÄÒ»¾ä´úÂë²»ÊÇÌ«Àí½â:
ͨ¹ýÅäºÏʹÓÃString¶ÔÏóµÄreplace()·½·¨¼°·´ÏòÒýÓ㬾ͿÉÒÔ¶¨Òå×Ô¼ºµÄtrim()·½·¨:
String.prototype.trim = function() {
var reExtraSpace = /^\s+(.*?)\s+$/;
return this.replace(reExtraSpace,"$1");
}
Ò»¿ªÊ¼ÔõôҲ²» ......
css,javascriptµÄÔ¤¼ÓÔØ
ΪÁËÌá¸ßÍøÕ¾µÄ¼ÓÔØËٶȣ¬ÓÐÒ»¸öºÜÖØÒªµÄÊֶξÍÊÇÔÚÓû§ä¯ÀÀ¹ý³ÌÖеÄÉÏÓÎÍøÕ¾×öÒ»¸öÎļþµÄÔ¤¼ÓÔØ¡£Ô¤¼ÓÔØÎļþÒ»°ãÓÐÁ½ÖÖ³£Óõķ½Ê½£ºxhrºÍ¶¯Ì¬²åÈë½ÚµãµÄ·½Ê½¡£¶¯Ì¬²åÈë½ÚµãÊÇ×îΪ¼òµ¥Ò²×îΪ¹ã·ºµÄÒ»ÖÖÒì²½¼ÓÔØ·½Ê½(ÀýÈçyuiµÄGetÄ£¿é)£¬È»ºóʹÓö¯Ì¬²åÈë½Úµã·½·¨¼ÓÔصÄÎļþ¶¼»áÔÚ¼ÓÔغóÁ¢¼´Ö´ÐУ¬ ......
ΪÁËÌá¸ßÍøÕ¾µÄ¼ÓÔØËٶȣ¬ÓÐÒ»¸öºÜÖØÒªµÄÊֶξÍÊÇÔÚÓû§ä¯ÀÀ¹ý³ÌÖеÄÉÏÓÎÍøÕ¾×öÒ»¸öÎļþµÄÔ¤¼ÓÔØ¡£Ô¤¼ÓÔØÎļþÒ»°ãÓÐÁ½ÖÖ³£Óõķ½Ê½£ºxhrºÍ¶¯Ì¬²åÈë½ÚµãµÄ·½Ê½¡£¶¯Ì¬²åÈë½ÚµãÊÇ×îΪ¼òµ¥Ò²×îΪ¹ã·ºµÄÒ»ÖÖÒì²½¼ÓÔØ·½Ê½(ÀýÈçyuiµÄGetÄ£¿é)£¬È»ºóʹÓö¯Ì¬²åÈë½Úµã·½·¨¼ÓÔصÄÎļþ¶¼»áÔÚ¼ÓÔغóÁ¢¼´Ö´ÐУ¬javascriptµÄÖ´ÐÐÒ»·½Ãæ»áÕ ......
Ò».ʹÓÃRegisterStartUpScript×¢²áÖ»Ö´ÐÐÒ»´ÎµÄjavascript
µÚ1²½(´´½¨²¢×¢²á²¢Ê¹ÓÃjavascript)£ºPage.aspx.cs
protected void Page_Load(object sender, EventArgs e)
{
//´´½¨JavaScript
string info = "<mce:script type="text/javascript"><!--alert('ÄãºÃ£¬ÎÒÊÇXXX£¡')// --></mce:scrip ......
1 javascript ÕýÔò
¶ÔÏó´´½¨ ºÍÓ÷¨
ÉùÃ÷javascript ÕýÔò
±í´ïʽ
¸´ÖÆ´úÂë
´úÂëÈçÏÂ:
var reCat = new RegExp("cat");
ÄãÒ²¿ÉÒÔ
var reCat = /cat/; //Perl ·ç¸ñ £¨ÍƼö£©
2 ѧϰ×î³£ÓÃµÄ test exec match search replace split 6¸ö·½·¨
1£© test ¼ì²éÖ¸¶¨µÄ×Ö·û´®ÊÇ·ñ´æÔÚ
¸´ÖÆ´úÂë
......