¸½¼þ×ÊÁÏ
*ÀàµÄÄÚ´æÐÅÏ¢£¨´úÂ룩
ʾÀý£º»ñÈ¡ÀàÐÅÏ¢
˵Ã÷£º±È¶Ôͨ¹ýÀàµØÖ·ÒÔ¼°Í¨¹ýÀà·½·¨»ñÈ¡ÐÅÏ¢µÄЧ¹û¡£
´úÂ룺
type
TMyObject = class(TObject)
private
FData: Integer;
protected
procedure Test1;virtual;
procedure Test2;dynamic;
public
procedure Test;
published
procedure Test3;
end;
procedure TMyObject.Test;
var
i:Integer;
begin
ShowMessage('¾²Ì¬·½·¨');
end;
procedure TMyObject.Test1;
begin
ShowMessage('Ðé·½·¨');
end;
procedure TMyObject.Test2;
begin
ShowMessage('¶¯Ì¬·½·¨');
end;
procedure TMyObject.Test3;
begin
......
*ÀàµÄ¹«¿ªÊôÐÔ£¨´úÂ룩
ʾÀý£º·ÃÎÊÀàµÄpublishedÊôÐÔ
˵Ã÷£ºvmtFieldTable£¨Published Field±í£©Ö¸ÏòPublished Field±íÓÐÐòÅÅÁУ¬Ö»´æ´¢µ±Ç°ÀàµÄPublishedField±í£¬µÃµ½¸¸ÀàµÄPublished Field±íÐèÒªÍùÉϱéÀú¡£
×¢Ò⣺ֻÓÐÀàÐÍÊÇÀà»ò½Ó¿ÚµÄÊý¾Ý³ÉÔ±²Å¿É¶¨ÒåΪpublishedµÄ·ÃÎʼ¶±ð
´úÂ룺
type
TMyObject = class(TObject)
private
FField1: Integer;
FField2: string;
FField3: array[0..2] of Integer;
published
Button1: TButton;
Memo1: TMemo;
Label1: TLabel;
end;
procedure TForm1.Button1Click(Sender: TObject);
var
AObject: TMyObject;
//---
procedure _ShowDMTInfo(ALines: TStrings; AClass: TClass);
& ......
function BrowseCallbackProc(Wnd: HWND; uMsg: UINT; lParam, lpData: LPARAM): Integer; stdcall;
begin
if uMsg = BFFM_INITIALIZED then
begin
SendMessage(Wnd, BFFM_SETSELECTION, 1, lpData);
SetWindowText(Wnd, 'Ñ¡ÔñÒ»¸öÄ¿±ê');
end;
Result := 0;
end;
//hdl: ´°¿Ú¾ä±ú
//Root: ¸ùĿ¼
//InitDir: ³õʼ»¯Â·¾¶
//Hint: ¶Ô»°¿òÌáʾÓï¾ä
function fBrowseFolder(hdl:THandle; const Root: String; const InitDir: string;
Hint: string = 'ÇëÑ¡ÔñÎļþ¼Ð'): string;
var
Info:TBrowseInfo;
Dir:array[0..260] of char;
ItemId, RootItemIDList:PItemIDList;
Eaten, Attribute: Cardinal;
ID: IShellFolder;
begin
FillChar(Info, SizeOf(TBrowseInfo), #0);
with Info do
begin
hwndOwner := hdl;
SHGetDesktopFolder(ID);
ID.ParseDisplayName(hdl, nil, POleStr(WideString(Root)), Eaten, RootItemIDList, Attribute);
pidlRoot := RootItemIDList;
pszDisplayName := nil;
lpszTitle:= PChar(Hint);
ulFlags:=BIF_RETURNONLYFSDIRS + BIF_NEWDIALOGSTYLE; //Èç² ......
// ѧϰҪÏ뿽±´ÄÇô¿ì¾ÍºÃÁË
//
// JavaScript µÄ¼Ì³ÐÊÇ»ùÓÚ prototype µÄ£¬Ã¿¸ö¶ÔÏóµÄ prototype ÊDZ£´æÔÚ¶ÔÏóµÄ __proto__ ÊôÐÔÖеģ¬Õâ¸öÊôÐÔÊÇÄÚ²¿(internal)µÄÊôÐÔ( ¹ßÀýÊÇÄÚ²¿µÄ»òÕßÒþ²ØµÄÊôÐÔÒÔ _ ¿ªÍ·)
// A prototype-based language has the notion of a prototypical object, an object used as a template from which to get the initial properties for a new object.
//
/**
* Property lookup in Javascript looks within an object's own properties and,
* if the property name is not found, it looks within the special object property __proto__.
* This continues recursively; the process is called "lookup in the prototype chain".
* The special property __proto__ is set when an object is constructed;
* it is set to the value of the constructor's prototype property.
* So the expression new Foo() creates an object with __proto__ == Foo.prototype.
* Consequently, changes to the properties of Foo.prototype alters the property lookup for all objects that were created by new Foo().
*/
// ......
1.document.formName.item('itemname')µÄÎÊÌâ
˵Ã÷£ºIEÏ¿ÉÒÔʹÓÃdocument.formName.item('itemname')ºÍdocument.formName.elements('elementsName');
FFÏÂÖ»ÄÜʹÓÃdocuement.formName.elements('elementsName');
½â¾ö·½·¨£ºÍ³Ò»Ê¹ÓÃdocuement.formName.elements('elementsName');
2.¼¯ºÏÀà¶ÔÏóÎÊÌâ
˵Ã÷£ºIEÏ¿ÉÒÔʹÓÃ[]ºÍ()»ñÈ¡¼¯ºÏÀà¶ÔÏ󣬵«FFÏÂÖ»ÄÜʹÓÃ[]»ñÈ¡¼¯ºÏ¶ÔÏó
½â¾ö·½·¨:ͳһʹÓÃ[]»ñÈ¡¼¯ºÏ¶ÔÏó
3.const ÎÊÌâ
˵Ã÷£ºFFÏ¿ÉÒÔʹÓÃconstºÍvar¶¨Òå³£Á¿£¬µ«ieÏÂÖ»ÄÜʹÓÃvarÀ´¶¨Òå³£Á¿
½â¾ö·½·¨£ºÓÃvar À´¶¨Òå³£Á¿
4.div¶ÔÏó
ÔÚIEÖпÉÊÇÖ±½ÓʹÓÃID×÷Ϊ¶ÔÏó±äÁ¿ÃûʹÓã¬ÔÚfirefoxÖоͲ»ÄÜ
Divid.style.display="none"
½â¾ö·½·¨£ºdocument.getElementByID('Divid').style.display="none";
5.inputµÄtypeÊôÐÔ
IEÏÂtypeÊôÐÔΪֻ¶ÁÊôÐÔ£¬¶øÔÚFFÏÂÊǿɶÁдÊôÐÔ
6.removeNode()
FFÏÂûremoveNode()Õâ·½·¨£¬±ØÐëʹÓÃÈçÏ·½·¨£¬
node.parentNode.removeChild(node);
7.img µÄsrcË¢ÐÂÎÊÌâ
IEÏ¿ÉÒÔË¢ÐÂͼƬ£¬µ«FFϲ»¿ÉÒÔ£¬Ö÷ÒªÊÇ»º´æÎÊÌ⣬ÔÚºóÃæ¼ÓËæ»ú²ÎÊý
½â¾ö·½·¨£º
myImg.src=this.src+'?'+Math.random();
δÍê.....´ýÐø
......
JavaScript For Ñ»·
Previous Page
Next Page
JavaScript ÖеÄÑ»·ÓÃÀ´½«Í¬Ò»¶Î´úÂëÖ´ÐÐÖ¸¶¨µÄ´ÎÊý£¨»òÕßµ±Ö¸¶¨µÄÌõ¼þΪ true ʱ£©¡£
ʵÀý
For Ñ»· ÈçºÎ±àд loop Ñ»·À´°´ÕÕÖ¸¶¨µÄ´ÎÊýÖ´ÐÐÏàͬµÄ´úÂë¡£ Ñ»·²úÉú HTML ±êÌâ ÈçºÎʹÓÃLoopÑ»·À´²úÉú²»Í¬µÄHTML±êÌâ¡£
JavaScript Ñ»·
ÔÚ±àд´úÂëʱ£¬Äã³£³£Ï£Íû·´¸´Ö´ÐÐͬһ¶Î´úÂë¡£ÎÒÃÇ¿ÉÒÔʹÓÃÑ»·À´Íê³ÉÕâ¸ö¹¦ÄÜ£¬ÕâÑù¾ÍÓò»×ÅÖØ¸´µØÐ´Èô¸ÉÐÐÏàͬµÄ´úÂë¡£
JavaScript ÓÐÁ½ÖÖ²»Í¬ÖÖÀàµÄÑ»·£º
for ½«Ò»¶Î´úÂëÑ»·Ö´ÐÐÖ¸¶¨µÄ´ÎÊý while µ±Ö¸¶¨µÄÌõ¼þΪ true ʱѻ·Ö´ÐдúÂë
for Ñ»·
Ôڽű¾µÄÔËÐдÎÊýÒÑÈ·¶¨µÄÇé¿öÏÂʹÓà for Ñ»·¡£
Óï·¨£º
for (±äÁ¿=¿ªÊ¼Öµ;±äÁ¿<=½áÊøÖµ;±äÁ¿=±äÁ¿+²½½øÖµ)
{
ÐèÖ´ÐеĴúÂë
}
ʵÀý£º
½âÊÍ£ºÏÂÃæµÄÀý×Ó¶¨ÒåÁËÒ»¸öÑ»·³ÌÐò£¬Õâ¸ö³ÌÐòÖÐ i µÄÆðʼֵΪ 0¡£Ã¿Ö´ÐÐÒ»´ÎÑ»·£¬i µÄÖµ¾Í»áÀÛ¼ÓÒ»´Î 1£¬Ñ»·»áÒ»Ö±ÔËÐÐÏÂÈ¥£¬Ö±µ½ i µÈÓÚ 10 Ϊֹ¡£
×¢ÊÍ£º²½½øÖµ¿ÉÒÔΪ¸º¡£Èç¹û²½½øÖµÎª¸º£¬ÐèÒªµ÷Õû for ÉùÃ÷ÖеıȽÏÔËËã·û¡£
<html>
<body>
<script type="text/javascript">
var i=0
for (i=0;i<=10;i++)
{
document.write("The number i ......