|
 |
 |
Print
version (in a new window)
What additional functions and variables are available
in JavaScript on a page, viewed through WebWarper?
Some of them were already mentioned in previous answers:
___ww,
___ww_correctUrl(),
___ww_correctHtml(),
___ww_setDomain(),
___ww_assignCookie().
Besides that, the following variables and functions can be helpful. (You can
use any of the listing functions only after getting sure, that the page is
really compressed using WebWarper: "if (window.___ww) {...".)
- ___ww_sizeOriginal: this variable usually contains the size (in bytes) of
the original page, before processing it by WebWarper.
- ___ww_sizeCompressed: this variable usually contains the size (in bytes) of
the page after processing it by WebWarper. Probably it's value will be much less
than ___ww_sizeOriginal. But the reverse situation is also possible — if gzip-compression
is not supported in the user's browser due to some reasons.
Unlike ___ww_sizeOriginal, this variable become available only after a little time
after after completion of loading the page. You may check presence of this variable by
"if (window.___ww_sizeCompressed!=null) {..." operators.
___ww_sizeOriginal and ___ww_sizeCompressed variables,
differently from other variables and functions, become inaccessible after
rebuilding the page by "document.open();
document.writeln(...); document.close();" operators.
- ___ww_msieversion(): function is returning integer number of
Microsoft Internet Explorer browser version (for example, 5 for MSIE 5.X),
or 0 for all other browsers.
- ___ww_netscapeversion(): function is returning integer number of
Netscape, Mozilla, FireFox browsers version (for example, 4 for NC 5.X,
5 or greater for all versions of Mozilla / FireFox),
4 for Opera browser since version 6.0, and 0 for all other browsers.
- ___ww_sFloat(v,n): function is returning decimal record of a
real number v with fixed decimal point, and n digits in mantissa; for
example, ___ww_sFloat(5.0376,2) = "5.04", ___ww_sFloat(-245.06,1)
= "-245.1". Differently from standard JavaScript ways of
transforming number into siring — v+"" or v.toString() — does
allow to precisely specify a number of digits after decimal point.
To contents
|