#1
Algunos codigos para tu web! el Dom Feb 15, 2009 3:57 pm
Algunos codigos para tu web! el Dom Feb 15, 2009 3:57 pmHola fue buscando y encontre alguos codigos espero que les guste no la gran cosa pero de todas formas :wink: : es de ayuda :
Calculadora en tu web :
Fecha en la barra de titulo
Imprimir web :
Detecta el navegador que utilizas :
Codigo que calcula la semana en que naciste y dia :
Entre las etiquetas
y dentro de las etiquetas:
Fuente :
http://www.efectosjavascript.com/
Y agrego :
Tu web este en todas las resoluciones ! :
Salu2 !
Calculadora en tu web :
- Código:
<form action name="Keypad">
<b><div align="center">
</b><center>
<b><table border="2" cellpadding="1" cellspacing="5" height="60" width="50">
<tbody>
<tr>
<td align="middle" colspan="3"><input name="ReadOut2" size="24" value="0" width="100%" style="text-align: right" /></td>
<td> </td>
<td><input name="btnClear" onclick="Clear()" type="button" value=" C " /></td>
<td><input name="btnClearEntry" onclick="ClearEntry()" type="button" value=" CE " /></td>
</b></center>
Fecha en la barra de titulo
- Código:
<script language="Javascript" type="text/javascript">
<!--
// ==========================
// (C) 2000 by CodeLifter.com
// http://www.codelifter.com
// Free for all users, but leave in this header
function doTheClock() {
window.setTimeout( "doTheClock()", 1000 );
t = new Date();
if(document.all || document.getElementById){
document.title = t.toString();
}else{
self.status = t.toString();
}
}
doTheClock()
//-->
</script>
Imprimir web :
- Código:
<a href="javascript:print()">Imprimir</a>
Detecta el navegador que utilizas :
- Código:
<script languaje="Javascript">
<!--
alert("Estas utilizando "+navigator.appName+" "+navigator.appVersion);
//-->
</script>
Codigo que calcula la semana en que naciste y dia :
Entre las etiquetas
- Código:
<head> y </head>
- Código:
<script language="Javascript">
<!-- Begin
function calculate() {
month = document.form.month.selectedIndex;
month = document.form.month.options[month].value;
day = document.form.day.selectedIndex;
day = document.form.day.options[day].value;
year = document.form.year.value;
var oyear=year
var dob = " "+ year +", "+month + ", "+day;
var thenx = new Date(dob);
var year=thenx.getYear();
if (year<100) year="19" + thenx.getYear();
else year=thenx.getYear();
if (year > 1969) wyear=year;
else {
if (oyear<1900) {
if (oyear>1800) {
wrelyear= (eval(oyear)-1801)%(28);
wyear = wrelyear+1981;
}
else wyear = 1970
}
else
if (oyear>1900) {wrelyear= (eval(oyear)-1901)%(28);
wyear= wrelyear+1985
}
else
if (oyear==1900) {wyear= 1990;
}
}
var dob = " "+ wyear +", "+month + ", "+day;
var thenx = new Date(dob);
var theday = thenx.getDay()+1;
var date=thenx.getDate();
var weekday = new Array(6);
weekday[1]="Sunday";
weekday[2]="Monday";
weekday[3]="Tuesday";
weekday[4]="Wednesday";
weekday[5]="Thursday";
weekday[6]="Friday";
weekday[7]="Saturday";
if (day != date) alert("Sorry! That appears to be an invalid date!"+day+" ..."+date+"::"+oyear+"..."+year+" "+dob+"=="+wyear+".-.-"+thenx+" "+day+" "+month);
else {
dayborn = weekday[theday];
dob = dayborn + ", " + month + " " + date + ", " + oyear + ".";
alert("Naciste un día " + dob);
}
}
// End -->
</script>
y dentro de las etiquetas:
- Código:
<body> </body>
- Código:
<form name=form>
<center>
<table border=2 cellspacing=0 cellpadding=0 bgcolor=white>
<tr><td colspan=3 align=center><font face="verdana, arial" size="-1">¿Cuando Naciste?</font></td></tr>
<tr><td align=center>
<select name="select">
<option value="" selected>Month
</option><option value="January">Jan
</option><option value="February">Feb
</option><option value="March">Mar
</option><option value="April">Apr
</option><option value="May">May
</option><option value="June">Jun
</option><option value="July">Jul
</option><option value="August">Aug
</option><option value="September">Sep
</option><option value="October">Oct
</option><option value="November">Nov
</option><option value="December">Dec
</option></select>
</td>
<td align=center>
<select name="day">
<option value="" selected>Day
</option><option value="1">01
</option><option value="2">02
</option><option value="3">03
</option><option value="4">04
</option><option value="5">05
</option><option value="6">06
</option><option value="7">07
</option><option value="8">08
</option><option value="9">09
</option><option value="10">10
</option><option value="11">11
</option><option value="12">12
Fuente :
http://www.efectosjavascript.com/
Y agrego :
Tu web este en todas las resoluciones ! :
- Código:
<script language=”Javascript”>
if (screen.width + “x” +screen.height == “640×480″) location.href=”pagina640×480.htm”
if (screen.width + “x” +screen.height == “800×600″) location.href=”pagina800×600.htm”
if (screen.width + “x” +screen.height == “1024×768″) location.href=”pagina1024×768.htm”
if (screen.width + “x” +screen.height == “RESOLUCION x NUEVA″) location.href=”paginaRESOLUCION x NUEVA.htm”
</script>
Salu2 !

Última edición por seba37 el Dom Feb 15, 2009 8:39 pm, editado 1 vez (Razón : 20 puntos muchas gracias)

Hola Invitado recuerda siempre leer las Reglas del foro para evitar problemas
Nunca olvides leer las nuevas normas del foro 8D
Puedes escbribir a las siguientes direcciones
hackerspan@tfwmail.co.cc
Hackerspan@promocionatupagina.com







Mensajes
Reputacion
Puntos
Localización
Edad







