procedure TForm1.Button2Click(Sender: TObject);
var
ls: TSTrings;
begin
WebBrowser1.Navigate('about:blank'); // reset the webbrowser
while WebBrowser1.ReadyState < READYSTATE_INTERACTIVE do // wait to load the empty page
Application.ProcessMessages;
if Assigned(WebBrowser1.Document) then
begin
ls := tstringlist.create;
try
ls.text := '<html> '+ '<head> '+ '</style> '+
' <style type="text/css">.recentcomments a{display:inline !important;padding:0 !important;margin:0 !important;}</style>'+ '</head> '+
'<body> '+ ' <object width="640" height="390"> '+
' <param name="movie" value="http://www.youtube.com/v/L7NWdxFAHdY&hl=en_US&feature=player_embedded&version=3"> '+
' </param><param name="allowFullScreen" value="true"> '+ ' </param><param name="allowScriptAccess" value="always"> '+
' </param><embed src="http://www.youtube.com/v/L7NWdxFAHdY&hl=en_US&feature=player_embedded&version=3" type="application/x-shockwave-flash" allowfullscreen="true" allowScriptAccess="always" width="640" height="390"> '+ ' </embed></object> '+ '</body> '+ '</html> ';
ls.savetofile('c:\loadwb.htm');
finally
ls.free;
end;
WebBrowser1.Navigate('file://c:\loadwb.htm');
end;
end;
thanks a lot for your reply and help.
I used your code but nothing was load in my webbrowse.
did you also use the html code that comes with that example?