.  

 

 

.
.

26 / 04 / 2017

Usuarios conectados: 2

Cargando documento...

Buscar:

.

Este Sitio:

Principal

Dreamweaver

Fireworks

JavaScript

CSS

Sonido

Artículos

Links

E-ufemismos

Descargas

Historial

 

Mailing List:

Suscríbete a la lista de correo, No practico spamming y ofrece algunas ventajas.

Pulsa aquí para saber más y suscribirte.

 

Recomendados:

Tecnorama >JavaScript

 

¿Carga rápido tu página?

Versión para imprimir | Translate this page

Este tutorial es casi una frivolidad, pero puede servir para empezar a conocer un poco del objeto date() y el método getTime() de JavaScript.
La idea es conseguir mostrar cuánto tiempo ha tardado la página en cargarse, algo de lo que uno se puede sentir orgulloso si ha hecho las cosas bien o que es mejor esconder. La idea me vino de algo que se ve habitualmente en muchos sitios que utilizan PHPNuke y se me ocurrió que se podía hacer algo parecido con JavaScript.

El método getTime() devuelve un valor en milisegundos, contados a partir del 1 de enero de 1970, pero para ello debemos crear una variable que almacene la fecha que queramos comprobar. Si no le indicamos una fecha como parametro, tomará como valor el momento actual. Si le pasáramos una fecha nos diría los milisegundos que han pasado desde ese 1 de enero de 1970. Por ejemplo, si quisieramos saber cuántos han pasado hasta el 15 de mayo de 1980 a las 13:45, escribiríamos:

laFecha=new date("May 15, 1980 13:45:00");//creamos la variable
losMilisegundos=laFecha.getTime(laFecha)//capturamos los milisegundos
document.write(losMilisegundos);//y los escribimos

Utilizaremos, aparte de nuestra propia función, algunas que ya nos ofrece Dreamweaver, ya que el tiempo que ha tardado en cargar aparecerá en una capa (tranquilos, no tendremos que colocarla, lo hará sola).Empecemos:

Estos scripts deben ir lo más cerca posible del encabezado del documento, para que el tiempo empiece a contar lo antes posible. Los dos últimos son de Dreamweaver : setTextOfLayer() y MM_findObj():

<script language="JavaScript">
//estas 2 lineas se ejecutan al cargar, ya que estan fuera de una funcion
var elInicio=new Date();//creamos el momento actual
var antes=elInicio.getTime()//sacamos su hora em milisegundos
//nuestra funcion
function cuantoTardo(){
var elFinal=new Date();//capturamos el momento actual en milisegundos
var despues=elFinal.getTime();
var diferencia=despues-antes;
var total="tiempo de carga:"+Math.round(diferencia/1000)+"segundos.";//redondeamos
MM_setTextOfLayer('cronometro','',total);//lo escribimos en la capa "cronometro"
}

function MM_findObj(n, d) { //v4.01
var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_setTextOfLayer(objName,x,newText) { //v4.01
if ((obj=MM_findObj(objName))!=null) with (obj)
if (document.layers) {document.write(unescape(newText)); document.close();}
else innerHTML = unescape(newText);
}
</script>

Con esto ya escrito en nuestro encabezado, deberemos crear una capa en nuestro cuerpo. No nos hará falta una capa de Dreamweaver, nos bastará simplemento ésto donde queramos que aparezca el resultado (tranquilos, que funciona):

<div id="cronometro">&nbsp;</div>

Y para terminar, simplemente llamar a la función cuando termine de cargar la página. ¿Cómo?. Sencillo, llamando al evento onLoad en la etiqueta <body>:

<body onLoad="cuantoTardo()">

En ese momento se ejecutará nuestra función y restará los milisegundos que capture a los que recogió cuando empezó a cargar la página.

La verdad que,siendo sencillo, queda hasta curioso cuando se pone en una página....

¿Comentarios? 43, de momento. Mostrando 1 ->5

1.- Hi friends am 22 now .ma dad got a fiat 1968 model way back when i was in furtoh grade..she looked beautiful as always..ma first drive with her was might be when i was in sixth grade ..today am a good d diver and can drive any dam car..we got a indigo marina back in 2005 and after that we din pay much attention towards ma fiat really feel sorry sometimes ..thats because she had a serious break problem ..and so obviously din drive her at all ma fiat had a good paint new interiors new tyres but the break thing was bad i love her a lot she looks dam good even today when i wash her during dasera as if she is sayin am still alive don forget me..the last time when i started her was in mid of 2007 and after that i just gave up din pay attentio n at all but i knew she was good enough but the excitment of the new car ws so much that i din think of correcting her brakes at all..but every year when i use to wash her for dasera i just use to sit an adore her she really looked beutiful,,some days back suddenly ma dad said lets give our fiat to someone who can use it ..i couldnt take at all as if someone is gonna take part of ma heart i then dicided that is somedays back i wont let that happen ..i wont let ma sweet heart some other hands..so now ma brain started workin..i got two bottles of oil poured into her and got a petrol of 200 rs and took ma indigo ka battery and gave her supply i thought she wont even reply at all thought she would be angry with me ..then with ma fingures crossed i twisted the key i heard ma sweet hearts voice after three years ..but now i was still not sure if she will start and will be alive ..i gave her ingnition for more seven times and beleave me at the eight time touch wood yes she started yes she was speaking so very smooth so very nice ..felt like never before .then i got a mechanic and plannin out for goa with her and ma friends friends just wanna tel you its a good car keep her if you have feelings attached to her she wont let you down speak wit her tell her how much you love her and how much you really care for her..love you all fiats and their oweners http://ztnnzuo.com [url=http://wzsvrzkril.com]wzsvrzkril[/url] [link=http://bsjyrbmokb.com]bsjyrbmokb[/link]

2.- Hello Everybody,I own a 1968 Fiat 1100. It was then that Premier Automobiles started using the currnet body shape on Fiat 1100. My car has original Italian engine. Has been with me since 1983. Once, it had been under flood waters for 2 months. After about 6 months, nothing of its seats and electricals was left. But using a spare battery, it cranked to life in second attempt itself.I really like this car. Though we have newer cars in our family, we still love our Fiat.But, sadly, it is in need of a full body overhaul. It is at present stationed at Ludhiana. If somebody could help me with a body kit of Premier Padmini, I would be highly obliged. If somebidy from Ludhiana here, do contact me at . As I stay at Delhi, I know about Mayapuri and Chandni Chowk. But it will be difficult to shift a body kit from here to Ludhiana. Please help! http://ceprtbeils.com [url=http://xghjgjnfk.com]xghjgjnfk[/url] [link=http://ihyhylat.com]ihyhylat[/link]

3.- dear fiat comrades,Premier panidmi is with me since 1991(model 1989). I am enjoying it.I love long drive. to be frank it never gave any trouble in the highway.Even Some minor repairs happen, I found some mechanic work shop near by.I wonder! Thanks to designer. It is the ONLY ONE CAR, even though seems to be old, with running condition giving the pleasure of driving to the PROUD owners.Enjoy driving our favourite Premier Padmini!n- All the Best.b jayaraman chennai16/3/2008parth says:I also own a Padmini 1990model. I can still drive it at a good 115 kmph. Recently I started thinking of modifying it to the rally sport.Change interiors, gear box, alloy wheels and the stuff. I am from Pune. I donot know where u r from but if u r from but it would be great if u could send me some details as to how to go about this modification task.my no is 09760205211Sameer says:Hi, I recently got a Premier Padmini 1982 model from my Aunty and want to know more abut this old but great car, can i make it more fuel efficiant and easy steering.Sameerbulletking says:iv a 1975 premier panidmi. its a fairly new engine (reworked). its a reliable car ( off course the electricals arent). once this car touches 80 km/hr driving speed.. therez lots of sound in the cabin of the car.. really not tolerable! could anyone tell me how to have this cabin sound reduced! another, how do u install airconditioning in such an old car?i want to install a new engine, wats the best alternative for hard core raw power?where in bangalore could i get a real good garage to carry out these modifications to the engine?thankyou guys! id be real oblidged to get all this information9880081251Samarendra Das says:Dear All I am a software engineer working in Hyderabad. I want to buy one fiat and modify it. If any body knows pls make a call 9490926309. Thanks and regardsS. DasA. Chatterjee says:Dear Kapil,I am from Chennai and I want to modify my premier panidmi and give it a coupe look. Can you lend me some design where from I can have some idea?Regards,Anirvijai Edilbert says:Dear fans of premier, I am using a premier panidmi model of 1992. The performance of the vehicle is simply superb.Yogesh, Sumit,Ladi, Gauri, Sukhi,Raman says:To day (25/5/2008) we hv purchased a Padmini Premier. We all r passionate abt it.We r going to modify it. We love it. It's so .cool. u will see it our website soonThanksYogesh, Sumit,Ladi, Gauri, Sukhi,Raman says:To day (25/5/2008) we hv purchased a Padmini Premier(Model: -1965). We all r passionate abt it.We r going to modify it. We love it. It's so .cool. u will see it our website soonThanksKrishnamachary VG says:Hi.. I am from Hyderabad. I want to buy Fiat 1100 car and modify it if any body knows it please let me know.. thanks a lot in advance prakash says:Padmini is the car, which india will never forgetFIAT RULES INDIATony says:Padmini / 118 NE, you will never like to be apart from it, once you have driven it.just change to radial tyre, bucket seats, bumper, face lift of exterior lights, BET there is no other car on the india roads to beat it.Ankush says:Hi, All.I own a 1986 Premier Padmini. I live in pune. I wanted to find out the address of FiaT Owners club in Pune and also its phone no.If anyone knows it please send me the information on srikanth reddy says:Hi all:I'm interested to buy Fiat 118NE diesel, 1995 or later model only in hyderabad with very good running condition. please contact me at 09766399503 or mail me at .

4.- Dear Friends,I am very glad to see all the above mentioned contmems and experiences of various Fiat lovers. I have an old car FIAT Premier Padmini of 1987 Oct model, in very good condition. It gave me 15 k.ms / ltr Petrol. I dont like to dispose it, because I love this car which is very much comfortable and better than Maruthi omni and Maruthi 800. I am not using this for the past one and half years. I have a great desire to convert it to LPG Gas, but very difficult to get permission from RTA now a days. They will give permission to fix LPG only for the vehicles after 1992 model onwards. I am struggling what to do ? I appreciate some good suggestions. I am living in Secunderabad. My contact Mobile no. 99 85 66 68 69My E.mail. id : .Secunderabad, 20th November, 2008Wishing you all the best. Prabhu

5.- Hi friends am 22 now .ma dad got a fiat 1968 model way back when i was in foturh grade..she looked beautiful as always..ma first drive with her was might be when i was in sixth grade ..today am a good d diver and can drive any dam car..we got a indigo marina back in 2005 and after that we din pay much attention towards ma fiat really feel sorry sometimes ..thats because she had a serious break problem ..and so obviously din drive her at all ma fiat had a good paint new interiors new tyres but the break thing was bad i love her a lot she looks dam good even today when i wash her during dasera as if she is sayin am still alive don forget me..the last time when i started her was in mid of 2007 and after that i just gave up din pay attentio n at all but i knew she was good enough but the excitment of the new car ws so much that i din think of correcting her brakes at all..but every year when i use to wash her for dasera i just use to sit an adore her she really looked beutiful,,some days back suddenly ma dad said lets give our fiat to someone who can use it ..i couldnt take at all as if someone is gonna take part of ma heart i then dicided that is somedays back i wont let that happen ..i wont let ma sweet heart some other hands..so now ma brain started workin..i got two bottles of oil poured into her and got a petrol of 200 rs and took ma indigo ka battery and gave her supply i thought she wont even reply at all thought she would be angry with me ..then with ma fingures crossed i twisted the key i heard ma sweet hearts voice after three years ..but now i was still not sure if she will start and will be alive ..i gave her ingnition for more seven times and beleave me at the eight time touch wood yes she started yes she was speaking so very smooth so very nice ..felt like never before .then i got a mechanic and plannin out for goa with her and ma friends friends just wanna tel you its a good car keep her if you have feelings attached to her she wont let you down speak wit her tell her how much you love her and how much you really care for her..love you all fiats and their oweners kapil kumar says:I have been a great fan of fiat .this car is very comfortable and economical to maintain.if u have a good knowledge about cars nothing better than this .these cars need a good knowledge other wise at times it creates a problem as we all know these cars are not new.send me a mail if u want to know how to take care of these cars.kapil kumar says:my email id is( }Glen says:Hi there,I am in the UK and I am wondering where I can get the spares for the Fiat 137D engine, and will they ship to the UK.Thanks in anicipation.Faleel Rahman says:hi all, i am also great fan for Fial Premier padmini. why dont we ask to premier ltd tostart to produce again premier padmini car? i think if we send request Premier auto ltd, they may be consider or will do the survey about that. think .my sugesstion is if premier auto ltd produce the same design but latest technology,Faleel Rahman says:and interior, with reasonable price, i am sure premier padmini will give tuff competition to other international brand cars. dear padmini fans consider to send request to PAL. thanksHemant Bhavsar says:Hi, i like Permier padmini & many people like this car. premier padmini is not failuer model, accualy i.e.some company problems about their personal issue, but people like that to restart premier padmini dissel version added with modify new technology of power stearing, power gear & breaks.Vijayalakshmi says:HI,I am also a big fan of the Premier Padmini 137d model.We own a 1995 model,she looks like a gracious lady,I love her for her elegant looks, I want to drive her with all the comfort of a brand new luxury car.I wish if there are any best mechanics for remodelling the interiors in Chennai.jude says:Hi friends i am from bangalore.im looking for a fiat 118 in bangalore within 35,000.if there is anyone intrested in sellin a good car call me. says:Hi Folks,I am happy to see you all still loving Fiats/Premier Padminis. Indeed these machines are still as good as any other car. Infact I compare them as Mustangs (Ford) in India. I have a Premier Padmini 1990 model and its still original and did close to 30,000 and trust me guys goes like a Rocket. I enjoy her throughly. She gives me all the fun which a muscle car could give. I always wanted to have a Italian Fiat for me which has come true. I now own a 1965 Fiat Delight which to my fortune is a single owner and very original including the paint. All fittings are Aluminium, original Dials, logo etc I am planning to give her a through restoration and just enjoy her for my lifetime.Thanks Folks, BalaFIATtitude continues .Saravanan K M says:Hi All,I am a great fan of Fiat Padmini Premier from my childhood days, recently from my family friend i got a well maintained 1980 model, unfortunetly the car was not used for a very long time(nearly 2years). I took it and with the help of one of the oldest fiat specalist Mr. Soundarajan from Chennai(Perimet), the loving one is came to l running condition. What is the maximum mileage (Petrol) can i expect from the loving car (or) for optium running shall i change to Gas. Kindly guide me on this.And to improve on Petrol mileage what should i have to do. Please help me on this with your valuable suggestion and guideline & advice. Thanks with cheers Sara Vikram Patil says:Hi. I want to know whether there are mechanics of FIAD PADMINI in Pune and Pimpri-Chinchwad area. Where can I get spare parts?Please help.Saravanan K M says:Great Vikram for your 1965 Fiat. If u have any photos of ur fiat kindly sent me to my mail id : . And how much estimation as given for restoreration, because i am also planning for restoreration of my loving car. What is the milage ur getting and what can be expected max. Kindly let me know it.Wish you all the best for ur restoreration.5a8Jerome says:I have a 1997 Fiat 137 D in a very very good condition.I have spend around 25K now.With Original bucket seat and floor shift.I am planning to sell my car.pls mail me atJerome says:have a 1997 Fiat 137 D in a very very good condition.I have spend around 25K now.It is in Coimbatore and its a single owner car.With Original bucket seat and floor shift.I am planning to sell my car. if you c the car you will definitely like.it for TRUE FIAT LOVERSpls mail me atasokan says:Dear FIAT lovers,Since I'm moving to abroad I thought of giving my FIAT 137D. It is a 1997 model, Diesel Engine,Bucket seat (with safety belts) in very good condition( I used to drive from Thiunelveli to Bangalore (600 KMs)often with out any trouble and the mileage I get is 20+. My number is 9600072495 and email id is . If any one interested please contact me.S.SUBRAMANIAN says:Dear Sir, Can you tell me the loc54d8ation of the car ( Chennai etc ) and the kilometers run so far? What's the price you are quoting ?I'm very much interested in buying the same. My mobile no.is 9444656331.Regards,S.SUBRAMANIAN says:Hi folks, I have a premier padmini 1991 model and due to the atrosious fuel prices in Hyderabad I am unable to use the car which I wanted to so now I have decided to convert into LPG. I would like to know the personal experiences of people who have converted their cars to LPG, please let me know the merits and de merits of the same. Do let me know about the personal experiences after converting the car to LPG which I will be thankful to you and it would be another effort to save few more cars which are sitting idle due to fuel expenses. ThanksVikramVikram Patil Pune says:Hi Friends,I want to buy a fiat padmini within 20000 in pune or Western Maharashtra. If there is anyone please contact me on . Thanks.Vikram. http://bvfhdts.com [url=http://msfrmqlccep.com]msfrmqlccep[/url] [link=http://wxvvmtncgg.com]wxvvmtncgg[/link]

« Previous | 1 - 5 | 6 - 10 | 11 - 15 | 16 - 20 | 21 - 25 | 26 - 30 | 31 - 35 | 36 - 40 | 41 - 43 | Next »

Añade tu comentario



Escribe el código de la imagen superior:

:

TECNORAMA es simplemente una página personal. No sirve ni de promoción del autor ni cosas por el estilo.
Todos los códigos, textos y tutoriales son de libre uso mientras se mencione al autor (no es mucho pedir)
Este sitio es compatible con IE6/NS6/Mozilla1.0
Para contactar, puedes enviarme un e-mail a tecnorama@hotmail.com