Witam
mam takie cos na stronie do logowania
<a href="#" onclick="return Index.submit_login('server_pl29');"><span class="world_button_active">Świat 29</span></a>
żeby kliko w wyznaczony serwer co trzeba zrobić? mam takie funkcje
function ExecuteScript(doc: IHTMLDocument2; script: string; language: string): Boolean;
var
win: IHTMLWindow2;
Olelanguage: Olevariant;
begin
if doc <> nil then
begin
try
win := doc.parentWindow;
if win <> nil then
begin
try
Olelanguage := language;
win.ExecScript(script, Olelanguage);
finally
win := nil;
end;
end;
finally
doc := nil;
end;
end;
end;
procedure WWWczekajNaWWW;
begin
while not(strona_sciagnieta) do
Application.ProcessMessages; //zwalnianie kolejki
end;
function www_wykonaj_skrypt(sNazwaSkryptu:string; WebBrowserX:TObject): boolean;
var
doc: IHtmlDocument2;
begin
strona_sciagnieta:=false;
TWebBrowser(WebBrowserX).ControlInterface.Document.QueryInterface(IHtmlDocument2, doc);
result:=ExecuteScript(doc, sNazwaSkryptu, 'JavaScript');
WWWczekajNaWWW;
end;
i tu wywyołanie kliknięcia
procedure TForm1.Button3Click(Sender: TObject);
var
IDoc: IHTMLDocument2;
begin
www_wykonaj_skrypt('document.submit_login(server_pl50)',WebBrowser1);
end;
i mi to nie działa, czy robie cos zle lub jest zła funkcja?