Home
Home Page
The menu of a choice in forms
The loader in HTML
Konfigurirovanie a site with the help of a file .htaccess
Options-Indexes
Perenapravlenie on other address
Replacement with the image. Method Farnera
Example the first. Headings of pages
Replace cautiously
Method of overlapping by a background (Cover-up Method)
WAP (Wireless Application Protocol)
Reduction of time of loading of webs - pages with help CSS
Mnogozadachnost` in JavaMe at HTTP connection
Interaction of streams.
Nine advice for job with Web 2.0
Beginning php to the programmer or how to start to earn
Substantiation of necessity of Storehouse of the data
Misses in the data
The directory by mistakes Oracle
Forms in HTML documents
Links
 

The loader in HTML

Let's consider a typical situation. The user has clicked on a hyperlink and the browser began zakachivat` the requested resource. We shall assume, that the user uses for connection to Internet the modem and effective speed (that is that speed from which the data are really sent) changes somewhere about{near} 20Kbit in a second. Such parameter for the Russian telephone lines - business ordinary. As we shall assume that the volume zakachivaemogo a file is equal 200Kb. Simple calculation shows, that the file will be loaded about 80 seconds.


In connection with such big time of loading there is a fear, that the user will not wait loadings. In fact before a resource progruzitsja, the user cannot define{determine}, whether there is a process of loading or a browser tries to open the dead link.


However, since 5 versions Internet Explorer gives the mechanism allowing in part to solve this problem. One of povedenij by default, behaviour download, gives a method startDownload. To a method startDownload it is passed two arguments: the address of a loaded resource and the index on function which will be called on end of loading of a resource.


Now we can intercept pressing a hyperlink and call a method startDownload with the address specified in a hyperlink. Simultaneously we can deduce{remove} the certain message warning the user that there is a loading of the big file on page. After end of loading the method startDownload will call the specified function which will make transition to a resource specified in a hyperlink. The given technics{technical equipment} is shown in the following listing.



<html>

<head>

<title> the Example of use download </title>

<meta http-equiv = "Content-Type" content = " text/html; charset=windows-1251 ">

<style type ='text/css'>

*loadManager {behavior: url (*default*download);}

</style>

<script language ='jscript '>

function ready_go ()

{

location.href = loaderManager.href;

}

</script>

</head>

<body>

<a href ='http: // webber.ru / ' id ='loadManager '

onclick ='this.startDownload (this.href, ok_func); '>

</body>

</html>


Can arise it would seem a reasonable question: in what sense of all these manipulations, if in result a resource eventually all the same gruzitsja in the old manner. All the matter is that the resource is loaded into second time not on a network, and from a cache that is much faster. In the second, small updating of the given method allows to bypass a problem of the torn hyperlinks. So having found out, that the method startDownload has not called our function during 10 minutes, it is possible to draw a conclusion, that a file to load it was not possible. And to deduce{remove} the message with an apology. The last will look much better, than the system message, that such resource to load it was not possible.


How to combine piksel to pikselu a background and contents in all browsers

I constantly hear, how beginning{starting} designers complain that when they need to combine any picture and a background in different browsers vygljadet on miscellaneous. Many speak, that the output{exit} no. I too so thought and constantly created javascript which would choose what Background to use for different browsers.


I have found an output{exit} and now I do not understand, how I earlier not dogodalsja! He works with MSIE3, MSIE4, NN3, NC4. I shall remind, that 97 % of users use one of them (or two (or three, as ja)). At once I warn, that I shall not say words about CSS as my way works for all browsers, switching NN3.


First I shall show a difference in how work MSIE and NETSCAPE with margins, and then I shall write code which needs to be used. Also I am completely confident, that other output{exit} no!!!


Speech I shall lead about thirds and the fourth versions of a Netscape. Both of them differ nothing in the plan margins besides that in the fourth version the tag <BODY MARGINWIDTH = * MARGINHEIGHT = *> is entered, similar to tag MSIE <BODY TOPMARGIN = * LEFTMARGIN = *> which is present in thirds and fourth versions MSIE. Certainly Netscape has not wanted simply to take and use the same names for parameters, and used parameter once the tag thought up by them for <FRAME MARGINWIDTH = * MARGINHEIGHT = *> about which mysteriousness I still shall tell.


That is it is possible to bring a small result! Using <BODY MARHINHEIGHT=0 MARGINWIDTH=0 TOPMARGIN=0 LEFTMARGIN=0> in MSIE3, MSIE4 and NC4, it is possible to get rid absolutely from margins.


On it I could and finish clause{article}, but you say: " And kakzhe NETSCAPE 3? 40 % of users of it{him} use. " And so for this reason I also write this clause{article}.


In what the main problem! As you also have understood in NC4 it is possible to supervise an arrangement content'? on a page. But! In a Netscape 3, alas it is impossible. That you would not do{make}, at you always will be margin from above and at the left about{near} 5 pikselov. I precisely do not know how much. It is a lot of. The unique way to get rid of them, it... To use frames! Yes, yes, frames! It is necessary simply naprosto to create two frames:



<FRAMESET ROWS = " *, 0 ">


The first frame is your page, and the second empty. It is the best way to put there



<HTML> </HTML>


Having made it, you to me say: " a fig. All the same there is a border. The matter is that you have forgotten, that the main frame dozhen to have at yourself MARGINHEIGHT=0 MARGINWIDTH=0:



<FRAME NAME = "home" SRC = "home.html" MARGINHEIGHT = "0" MARGINWIDTH = "0">


Before it to make, check up, that in file HOME.HTML, was not MARGINGHEIGHT and MARGINWIDTH in tage BODY. Otherwise you can spoil compatibility of page in NN3 and NC4.


Having made it, you will notice a problem. In both netskapakh all looks equally: you will see border in one piksel from above and at the left, but in MSIE borders at all will not be. Therefore, you should put



<BODY TOPMARGIN=1 LEFTMARGIN=1>


In HOME.HTML. Now it is similar, that is identical. But it is necessary to finish something. First in the second frame it is necessary to put



<FRAME... NORESIZE SCROLLING=NO>


And in FRAMESET:



<FRAMESET ROWS = " *, 0 " BORDER=0>


If not will be BORDER=0 at you the white strip below in MSIE will appear. The problem which I could not remove, is a white strip below at NN3 and NC4 even if is BORDER=0. That I only did not add in <FRAMESET> and <FRAME>. I have tried all: BORDER=0, FRAMESPACING=0, FRAMEBORDER=0|NO. If you will find an output{exit} write to me. But it should not excite us strongly. It is necessary for us izbavljatsja from borders. Color of that strip, it is possible to change in <BODY BGCOLOR> in an empty file.


Well, all seems I has said. And now I shall show you a code... About! Has forgotten. I have forgotten to tell, how I till now cannot understand zagadachnost` MARGINWIDTH and MARGINHEIGHT in Netskape 3 and 4. Try, and you will fall from a chair when will see how Netskehjp itself deceives.


Try to clean{remove} in a tag <FRAME> parameter MARGINHEIGHT=0. Also look at page in both Netskehjpakh. The top border in general will disappear, and left remain! Now put back and clean{remove} MARGINWIDTH=0. The left border will disappear, and from above there will be one piksel! And now prikol, clean{remove} both parameters! You receive that, chetyrjokh-five piksel`nuju border.


And now try to explain to me this law in a Netscape! Now I hope you have understood, that in Netskape 3 it is impossible to get rid of both borders at once. I think, that the most optimum variant would be to have one piksel at the left and from above. And for this purpose a code:


INDEX.HTML:



<HTML> <HEAD>

<TITLE> </TITLE>

</HEAD>

<FRAMESET ROWS = " *, 0 " BORDER=0>

<FRAME NAME = "home" SRC = "home.html" MARGINHEIGHT = "0" MARGINWIDTH = "0">

<FRAME NAME = "empty" SRC = "empty.html" NORESIZE SCROLLING=NO>

</FRAMESET>

</HTML>


HOME.HTML:



<HTML> <HEAD>

<TITLE> </TITLE>

</HEAD>

<BODY TOPMARGIN=1 LEFTMARGIN=1>

Your stuff

</BODY>

</HTML>


EMPTY.HTML:



<HTML>

<BODY BGCOLOR = * FFFFFF> (depending on color in the main frame)

</HTML>


With this code, you can safely create BGehshki and combine them with contentom on a page. Vygljadit` all will be identical in all browsers (97 %). "All" I mean borders a word.


Unique problem - this that strip below in Netskapakh.