htmlutils.pas 678 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. library htmlutils;
  2. uses
  3. web;
  4. Type
  5. THTMLUtils = class(TObject)
  6. Public
  7. DefaultClearID : String;
  8. Procedure SetPageTitle(aTitle : String);
  9. Procedure ClearPage(aBelowID : String);
  10. end;
  11. Procedure THTMLUtils.SetPageTitle(aTitle : String);
  12. begin
  13. Document.Title:=aTitle;
  14. end;
  15. Procedure THTMLUtils.ClearPage(aBelowID : String);
  16. Var
  17. EL : TJSElement;
  18. begin
  19. if (aBelowID='') then
  20. aBelowID:=DefaultClearID;
  21. if (aBelowID='') then
  22. el:=Document.body
  23. else
  24. el:=Document.getElementById(aBelowID);
  25. if Assigned(El) then
  26. El.innerHTML:='';
  27. end;
  28. var
  29. Utils : THTMLUtils;
  30. exports
  31. Utils;
  32. initialization
  33. Utils:=THTMLUtils.Create;
  34. end.