javascript ʵÏÖÁª¶¯µÄÏÂÀ²Ëµ¥
<form name="f1"><select name="s1"
onchange="chg(document.f1.s1,document.f1.s2)">
<option value="½Î÷">½Î÷</option>
<option value="¸£½¨">¸£½¨</option>
</select><select name="s2">
<option value="1">1</option>
</select></form>
<script>
//´´½¨¶ÔÏó£¬Êý¾Ý£¬Öµ£¬Îı¾
function obj(aData, aValue, aText) {
this.Data = aData;
this.Value = aValue;
this.Text = aText;
}
//ÉèÖÃÑ¡ÏîÊý¾ÝÊý×飬¿ÉÒÔÌí¼Ó¶à¸ö²ÎÊýΪ"Ô´µØÖ·,Ñ¡ÔñÖµ£¬Ñ¡ÔñÎı¾"
var Set_data = new Array(
new obj('½Î÷', 'Äϲý', 'Äϲý'),
new obj('½Î÷', '¾Å½','¾Å½'),
new obj('¸£½¨', '¸£ÖÝ', '¸£ÖÝ'),
new obj('¸£½¨', 'ÏÃÃÅ', 'ÏÃÃÅ'));
//¸Ãº¯Êý½ÓÊÜÁ½¸ö²ÎÊý——Á½¸öÏÂÀ²Ëµ¥
function chg(parent, child) {
//ÒÔ¸¸²Ëµ¥µÄÑ¡ÖÐÑ¡ÏîµÄÖµ£¬×Ӳ˵¥£¬ºÍÑ¡ÏîÊýÊý¾Ý×éΪ²ÎÊýµ÷ÓÃchgº¯Êý
chgComitem(parent.options[parent.selectedIndex].value, child, Set_data);
}
function chgComitem(parentValue, child, objs) {
//¸Ä±ä×Ӳ˵¥ //1.ÒÔ×Ӳ˵¥Îª²ÎÊýµ÷Óú¯Êý
DelAllComitem(child);
//2.±éÀúËùÓеÄÑ¡ÏîÊý¾Ý
for (i = 0; i < objs.length; i++) {
//Èç¹ûÑ¡ÏîÊý¾ÝµÄDataÓ븸²Ëµ¥Ñ¡ÖÐÖµÒ»ÑùµÄ»°
if (objs[i].Data == parentValue)
//3.ÒÔ×Ӳ˵¥£¬Ñ¡ÏîÊý¾ÝµÄÖµ£
Ïà¹ØÎĵµ£º
ÇëÏÈ¿´ÏÂÌ⣺
if(true)
{
a = 1;
}
alert(a); //Êä³öɶ£¿
if(true)
{
var a = 1;
}
alert(a); //ÕâÓÖÊä³öʲô£¿
ÔÚfirefox3.5Ï£¬µÚÒ»¸öÊä³ö1;µÚ¶þ¸öÊä³öundefined£¡£¡£¡
ÎªÉ¶ÄØ£¿ºÇºÇ£¬±¾ÈËÔڴ˰àÃÅŪ¸«Ò»Ï£º
Ò»°ãÇé¿öÏÂȱʡvarÉùÃ÷ʱ£¬Ä¬È ......
2¡¢ÔÐÍ·½Ê½
/**
* PersonÀࣺ¶¨ÒåÒ»¸öÈË£¬ÓиöÊôÐÔname£¬ºÍÒ»¸ögetName·½·¨
*/
function Person(){}
Person.prototype.name = "jack";
Person.prototype.getName = function() { return this.name;}
°ÑÀàµÄÊôÐÔ£¨×ֶΣ©£¬·½·¨¶¼¹ÒÔÚprototypeÉÏ¡£
Ô켸¸ö¶ÔÏó²âÊÔÏ£º
var p1 = new Person();
var ......
Introduction
This article is about passing data between VB.NET/C# WinForms and JavaScript.
Before reading further, let me warn you that this article is not about ASP.NET. Concepts covered in the article are applied to Desktop applications.
Background
I was working on a project which required dat ......
½ñÌì¿´µ½¡¶AJAX¿ª·¢¼òÂÔ¡·ÖÐËùÓеÄ<A href>¶¼Óõ½ÁËjavascript:void(0)
½ñÌì¿´ÁËÒ»ÏÂÔÀ´Õâ¸ö±í´ïʽµÄ×÷ÓþÍÊÇÈõ±Ç°Õâ¸ö³¬Á´½Ó³ÉΪһ¸öËÀÁ´½Ó£¬¾ÍÊÇʲô¶¼²»×÷¡£
ÒÔÏÂÕª×Ô£º
http://blog.csdn.net/mouyong/archive/2007/01/24/1491761.aspx
±ðÈËЩµÄJavaScript½Å±¾¿ÉÒÔ¿´µ½ÕâÑùµÄ´úÂ룺
<a href="javascript ......
¿´µ½Ò»ÆªÈëÃŵÄJS¼Ì³ÐÎÄÕÂ,×ªÔØÏÂ
ÔµØÖ·:http://sdcyst.javaeye.com/blog/288813
Àà±äÁ¿/Àà·½·¨/ʵÀý±äÁ¿/ʵÀý·½·¨
ÏȲ¹³äÒ»ÏÂÒÔǰд¹ýµÄ·½·¨:
ÔÚjavascriptÖÐ,ËùÓеķ½·¨¶¼ÓÐÒ»¸öcall·½·¨ºÍapply·½·¨.ÕâÁ½¸ö·½·¨¿ÉÒÔÄ£Äâ¶ÔÏóµ÷Ó÷½·¨.ËüµÄµÚÒ»¸ö²ÎÊýÊǶÔÏó,ºóÃæµÄ
²ÎÊý±íʾ¶ÔÏóµ÷ÓÃÕâ¸ö·½·¨Ê±µÄ²ÎÊý(ECMAScript spec ......