我想在我的网站上创建一个实时搜索引擎。我已经复制了这个: http://www.w3schools.com/php/php_ajax_livesearch.asp
这是我脚本的HTML。我做错了什么?
我的网站尚未在服务器上联机,这可能是问题吗?
我保存的文件与w3schools中的描述完全相同。
HTML:
type
TMyComponent = class(TPanel)
private
{ Private declarations }
Edit:TEdit;
FValue:String;
Procedure SetValue(Const Value:String);
protected
{ Protected declarations }
Constructor Create(Aoner:TComponent); Override;
Destructor Destroy; Override;
public
{ Public declarations }
published
{ Published declarations }
Property Value:String Read FValue Write SetValue;
end;
procedure Register;
implementation
procedure Register;
begin
RegisterComponents('Samples', [TMyComponent]);
end;
Constructor TMyComponent.Create(Aoner:TComponent);
begin
Inherited;
Width:=100;
Height:=100;
Edit:=TEdit.Create(Self);
Edit.Parent:=Self;
Edit.Width:=30;
Edit.Text:='';
Edit.Align:=TAlignLayout.Scale;
end;
Procedure TMyComponent.SetValue(const Value: string);
begin
FValue:=Value;
Edit.Text:=FValue;
end;
Destructor TMyComponent.Destroy;
begin
Edit.Destroy;
Inherited Destroy;
end;
end.
在此代码上方,我粘贴了w3学校的HTML代码。