Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

Delphi 

For loop in twebbrowser navigate.

Hi all.
I wanna make a for lopp for this example.

webbrowser1.navigate('javascript: $("[value=1]").click();') from
webbrowser1.navigate('javascript: $("[value=100]").click();') to

the variable is the value will.

i will make the clicking with timer.
thanks
pls help mee
Code
var
  V:String;
  I:Integer;
begin
  for i := 1 to 100 do begin
    V := 'j $("[value=' + IntToStr(I) + ']").click();';
    webbrowser1.navigate(V);
  end;
end;
(Mar 23, 2014 07:38 AM)SBMK Wrote:  
Code
var
  V:String;
  I:Integer;
begin
  for i := 1 to 100 do begin
    V := 'j $("[value=' + IntToStr(I) + ']").click();';
    webbrowser1.navigate(V);
  end;
end;
I tryed bt not work. i give white background in the webbrowser with [object,object]
string. here is my code

procedure TForm1.Timer1Timer(Sender: TObject);
var
value:string;
i:integer;
begin
for i :=805762 to 805764 do begin
value := 'javascript:$("[name=' + IntToStr(i) + ']").click();';
webbrowser1.navigate(value);
end;
end;
(Mar 23, 2014 10:14 AM)zsolt1126 Wrote:  I tryed bt not work. i give white background in the webbrowser with [object,object]
string. here is my code

procedure TForm1.Timer1Timer(Sender: TObject);
var
value:string;
i:integer;
begin
for i :=805762 to 805764 do begin
value := 'javascript:$("[name=' + IntToStr(i) + ']").click();';
webbrowser1.navigate(value);
end;
end;

try to add a delay after every navigate() like sleep for one second.
(Mar 24, 2014 09:01 AM)SBMK Wrote:  try to add a delay after every navigate() like sleep for one second.

The problem was the IE 11. I changed explorer7 and now work.:) The code was good. thanks :)


Possibly Related Threads...
Thread / Author Replies Views Last Post
[Delphi] by tcshOct 11, 2017 11:03 AM 11 630 Oct 11, 2017 11:03 AM
Last Post: tcsh
[Delphi] by sexxihexxiOct 9, 2015 02:16 PM 1 304 Oct 9, 2015 02:16 PM
Last Post: pettola86
[Delphi] by zsolt1126Apr 15, 2014 07:06 PM 4 250 Apr 15, 2014 07:06 PM
Last Post: gothie