Pues eso, me gustaría incluir en mi web un traductor de idiomas online, el tiempo en mi ciudad, calculadoras, etc. ¿Dondé puedo encontrar esto?
(no sabía en que foro incluirlo. Cambiadlo si lo veis necesario)
Gracias y un saludo
| |||
recursos para mi web (traductores, el tiempo, calc,...) Pues eso, me gustaría incluir en mi web un traductor de idiomas online, el tiempo en mi ciudad, calculadoras, etc. ¿Dondé puedo encontrar esto? (no sabía en que foro incluirlo. Cambiadlo si lo veis necesario) Gracias y un saludo |
| ||||
Una calculadora cientifica
Código:
<script language=javascript> <!-- // Scientific Calculator written by Eni Generalic - http://www.ktf-split.hr/~eni/ // If you use a variant of this in your page, then please email me ([email protected]) //esto va en el <head> var broj = "0" var tocka = 0 var eksp = 0 var eksponent = 3 var rjesenje = 0 var decimala = 0 var enter = ""; function memory(operator) { document.racunalo.zadatak.focus(); if (operator == 1) { // MS document.racunalo.memorija.value = document.racunalo.rezultat.value } else if (operator == 2) { // MR var memorija = document.racunalo.memorija.value; if (memorija==0 || slovo(memorija.charAt(0))) {memorija = ""}; document.racunalo.zadatak.value += memorija } else if (operator == 3) { // CLS if (document.racunalo.zadatak.value == "") { document.racunalo.rezultat.value = "" } else { document.racunalo.zadatak.value = "" } } } function display(noviznak) { if (noviznak=="") {document.racunalo.zadatak.focus()} else {document.racunalo.rezultat.select()} } function dodajBroj(noviznak) { document.racunalo.zadatak.focus(); document.racunalo.zadatak.value += noviznak } function izracunaj(zarez) { var pitanje = ""; var mem = 0; if (zarez >= 1) { if (document.racunalo.zadatak.value == "") { broj = document.racunalo.rezultat.value } else { broj = document.racunalo.zadatak.value; if (ubacirezultat(broj.charAt(0))) { broj = document.racunalo.rezultat.value + broj } } } for (var i=0; i<broj.length; i++) { if (broj.charAt(i) == ",") {pitanje += "."} else if (broj.charAt(i) == " ") {} else {pitanje += broj.charAt(i)} } if (operator(broj.charAt(broj.length-1))) {return false}; pitanje = eval("1*" + pitanje); if (zarez > 1) { pitanje = matematika(zarez, pitanje) } document.racunalo.oldrezultat.value = pitanje; zaokruzi(pitanje); document.racunalo.zadatak.value = ""; document.racunalo.zadatak.focus() } function matematika(zarez, rjesenje) { with (Math) { if (zarez == 2) { rjesenje = pow(rjesenje, 2) } else if (zarez == 3) { rjesenje = sqrt(rjesenje) } else if (zarez == 4) { rjesenje = -rjesenje } else if (zarez == 5) { rjesenje = log(rjesenje) } else if (zarez == 6) { rjesenje = pow(E, rjesenje) } else if (zarez == 7) { rjesenje = 1/rjesenje } else if (zarez == 8) { rjesenje = log(rjesenje)/LN10 } else if (zarez == 9) { rjesenje = pow(10, rjesenje) } else if (zarez >= 10 && zarez <= 12) { if (zarez == 10) { rjesenje = atan(rjesenje) } else if (zarez == 11) { rjesenje = acos(rjesenje) } else if (zarez == 12) { rjesenje = asin(rjesenje) } if (document.racunalo.stupnjevi[1].checked) {rjesenje = (rjesenje * 180) / PI} } else if (zarez >= 14 && zarez <= 16) { if (document.racunalo.stupnjevi[1].checked) {radijani = (rjesenje / 180) * PI} else {radijani = rjesenje}; if (zarez == 14) { rjesenje = tan(radijani) } else if (zarez == 15) { rjesenje = cos(radijani) } else if (zarez == 16) { rjesenje = sin(radijani) } } else if (zarez == 17) { rjesenje = rjesenje/100 } else if (zarez == 18) { rjesenje = rjesenje/1000000 } else if (zarez == 20) { rjesenje = factorial(rjesenje) } else if (zarez == 21) { eksponent = prompt("Unesite eksponent / Please enter exponent", 3); rjesenje = pow(rjesenje, eksponent) } else if (zarez == 22) { eksponent = prompt("Unesite korijen / Please enter root", 3); rjesenje = pow(rjesenje, (1/eksponent)) } return rjesenje } } function zaokruzi(ebroj) { decimala=parseFloat(document.racunalo.izaZareza.options[document.racunalo.izaZareza.selectedIndex].value); var strbroj = ebroj + " "; if (strbroj.charAt(0) == ".") {strbroj = "0" + strbroj}; var intbroj = strbroj.length - 1; deczarez(strbroj); if (intbroj > 16 && eksp == -1) { if (decimala == -1) {decimala = 14}; strbroj = izazareza(strbroj.substring(0,intbroj)) + " "; intbroj = strbroj.length - 1; deczarez(strbroj) } if (decimala >= 0 && decimala != 14) { if (tocka > 0) { var odgovor = izazareza(strbroj.substring(0,intbroj)) } else { ebroj = strbroj.substring(0,intbroj); if (decimala > 0) { ebroj += "."; for (var n = 0; n < decimala; n++) { ebroj += "0" } } var odgovor = ebroj } } else { decimala = 14; var odgovor = izazareza(strbroj) } if (odgovor.charAt(0) == ".") {odgovor = "0" + odgovor}; document.racunalo.rezultat.value = odgovor; } function deczarez(novibroj) { tocka = 0; eksp = 0; tocka = novibroj.indexOf("."); eksp = novibroj.indexOf("e") } function izazareza(novibroj) { with (Math) { if (eksp == -1) { var duzina = tocka; if (duzina == -1) {duzina = novibroj.length}; var desni = ""; if (duzina > 16) { var privremeni = round(novibroj*pow(10, 18)) + " "; var novie = privremeni.indexOf("e"); var lijevi = (privremeni.substring(0,novie)); lijevi = round(lijevi*pow(10, 15))/pow(10, 15) + " "; desni = (privremeni.substring(novie+2,privremeni.length-1)); desni = "e+" + (desni-18) } else { var lijevi = round(novibroj*pow(10, decimala))/pow(10, decimala) + " " } } else { var lijevi = novibroj.substring(0,eksp); var desni = novibroj.substring(eksp,novibroj.length); lijevi = round(lijevi*pow(10, decimala))/pow(10, decimala) + " " } lijevi = lijevi.substring(0,lijevi.length - 1); if (lijevi.charAt(0) == ".") {lijevi = "0" + lijevi}; if (decimala < 14) { if (lijevi.indexOf(".") == -1 && decimala != 0) {lijevi += "."}; var nula = (tocka + decimala) - (lijevi.length - 1); if (nula > 0 && decimala > 0) { for (var n = 0; n < nula; n++) { lijevi += "0" } } } return (lijevi + " " + desni) } } function factorial(n) { if ((n == 0) || (n == 1)) { return 1 } else { var odgovor = (n * factorial(n-1)); return odgovor } } function slovo(znak) { var slovo="(ABCDEFGHIKLMNOPRSTUVWXYZ"; for (var i=0; i<slovo.length; i++) if (znak == slovo.charAt(i)) {return true} {return false} } function operator(znak) { var matoperator="*/+-"; for (var i=0; i<matoperator.length; i++) if (znak == matoperator.charAt(i)) {return true} return false } function ubacirezultat(znak) { var ubacirezultat="*/+"; for (var i=0; i<ubacirezultat.length; i++) if (znak == ubacirezultat.charAt(i)) {return true} return false } //Eni Generalic, Split, Create: 1999/10/14; Update: 2001/12/10 --> </script>
__________________ Keep f***ing learning Ask for f***ing help. Use f***ing spell check. Think about all the f***ing possibilities. |
| ||||
Código:
<TR> <TD style="font-family: Arial, Verdana; font-size: 10pt"> <INPUT HEIGHT="28" WIDTH="38" TYPE="button" NAME="kvadrat" VALUE="x^2" TITLE="Square" onClick="izracunaj(2)" STYLE="BACKGROUND: #CDCDCD; FONT-SIZE: 10pt; HEIGHT: 28px; WIDTH: 38px"> </TD> <TD style="font-family: Arial, Verdana; font-size: 10pt"> <INPUT HEIGHT="28" WIDTH="38" TYPE="button" NAME="potencija" VALUE="x^y" TITLE="Power" onClick="izracunaj(21)" STYLE="BACKGROUND: #CDCDCD; FONT-SIZE: 10pt; HEIGHT: 28px; WIDTH: 38px"> </TD> <TD style="font-family: Arial, Verdana; font-size: 10pt"> <INPUT HEIGHT="28" WIDTH="38" TYPE="button" NAME="aln" VALUE="e^x" TITLE="Natural antilogarithm" onClick="izracunaj(6)" STYLE="BACKGROUND: #CDCDCD; FONT-SIZE: 10pt; HEIGHT: 28px; WIDTH: 38px"> </TD> <TD style="font-family: Arial, Verdana; font-size: 10pt"> <INPUT HEIGHT="28" WIDTH="38" TYPE="button" NAME="alog" VALUE="10^x" TITLE="Common antilogarithm" onClick="izracunaj(9)" STYLE="BACKGROUND: #CDCDCD; FONT-SIZE: 10pt; HEIGHT: 28px; WIDTH: 38px"> </TD> <TD style="font-family: Arial, Verdana; font-size: 10pt"> <INPUT HEIGHT="28" WIDTH="38" TYPE="button" NAME="cos" VALUE="cos" TITLE="Cosine" onClick="izracunaj(15)" STYLE="BACKGROUND: #CDCDCD; FONT-SIZE: 10pt; HEIGHT: 28px; WIDTH: 38px"> </TD> <TD style="font-family: Arial, Verdana; font-size: 10pt"> <INPUT HEIGHT="28" WIDTH="38" TYPE="button" NAME="acos" VALUE="acos" TITLE="Arc cosine" onClick="izracunaj(11)" STYLE="BACKGROUND: #CDCDCD; FONT-SIZE: 9pt; HEIGHT: 28px; WIDTH: 38px"> </TD> </TR> <TR> <TD style="font-family: Arial, Verdana; font-size: 10pt"> <INPUT HEIGHT="28" WIDTH="38" TYPE="button" NAME="sign" VALUE="+/-" TITLE="Change sign" onClick="izracunaj(4)" STYLE="BACKGROUND: #CDCDCD; FONT-SIZE: 10pt; HEIGHT: 28px; WIDTH: 38px"> </TD> <TD style="font-family: Arial, Verdana; font-size: 10pt"> <INPUT HEIGHT="28" WIDTH="38" TYPE="button" NAME="1/x" VALUE="1/x" onClick="izracunaj(7)" STYLE="BACKGROUND: #CDCDCD; FONT-SIZE: 10pt; HEIGHT: 28px; WIDTH: 38px"> </TD> <TD style="font-family: Arial, Verdana; font-size: 10pt"> <INPUT HEIGHT="28" WIDTH="38" TYPE="button" NAME="fact" VALUE="x!" TITLE="Factorial" onClick="izracunaj(20)" STYLE="BACKGROUND: #CDCDCD; FONT-SIZE: 10pt; HEIGHT: 28px; WIDTH: 38px"> </TD> <TD style="font-family: Arial, Verdana; font-size: 10pt"> <input height="28" width="38" type="button" name="PI" value="Pi" onClick="dodajBroj(Math.PI)" style="BACKGROUND: #CDCDCD; FONT-SIZE: 10pt; HEIGHT: 28px; WIDTH: 38px"> </TD> <TD style="font-family: Arial, Verdana; font-size: 10pt"> <INPUT HEIGHT="28" WIDTH="38" TYPE="button" NAME="sin" VALUE="sin" TITLE="Sine" onClick="izracunaj(16)" STYLE="BACKGROUND: #CDCDCD; FONT-SIZE: 10pt; HEIGHT: 28px; WIDTH: 38px"> </TD> <TD style="font-family: Arial, Verdana; font-size: 10pt"> <INPUT HEIGHT="28" WIDTH="38" TYPE="button" NAME="asin" VALUE="asin" TITLE="Arc sine" onClick="izracunaj(12)" STYLE="BACKGROUND: #CDCDCD; FONT-SIZE: 10pt; HEIGHT: 28px; WIDTH: 38px"> </TD> </TR> <TR> <TD COLSPAN=6 style="font-family: Arial, Verdana; font-size: 10pt"></TD> </TR> <TR> <TD style="font-family: Arial, Verdana; font-size: 10pt"> <INPUT HEIGHT="32" WIDTH="38" TYPE="button" NAME="7" VALUE="7" onClick="dodajBroj(7)" STYLE="BACKGROUND: #DEDEDE; FONT-SIZE: 12pt; HEIGHT: 32px; WIDTH: 38px"> </TD> <TD style="font-family: Arial, Verdana; font-size: 10pt"> <INPUT HEIGHT="32" WIDTH="38" TYPE="button" NAME="8" VALUE="8" onClick="dodajBroj(8)" STYLE="BACKGROUND: #DEDEDE; FONT-SIZE: 12pt; HEIGHT: 32px; WIDTH: 38px"> </TD> <TD style="font-family: Arial, Verdana; font-size: 10pt"> <INPUT HEIGHT="32" WIDTH="38" TYPE="button" NAME="9" VALUE="9" onClick="dodajBroj(9)" STYLE="BACKGROUND: #DEDEDE; FONT-SIZE: 12pt; HEIGHT: 32px; WIDTH: 38px"> </TD> <TD style="font-family: Arial, Verdana; font-size: 10pt"> <INPUT HEIGHT="32" WIDTH="38" TYPE="button" NAME="djeljeno" VALUE="/" onClick="dodajBroj('/')" STYLE="BACKGROUND: #DEDEDE; FONT-SIZE: 12pt; HEIGHT: 32px; WIDTH: 38px"> </TD> <td style="font-family: Arial, Verdana; font-size: 10pt"> <input height="32" width="38" type="button" name="ppm" value="ppm" title="Part per milion" onClick="izracunaj(18)" style="BACKGROUND: #CDCDCD; FONT-SIZE: 10pt; HEIGHT: 32px; WIDTH: 38px"> </td> <td style="font-family: Arial, Verdana; font-size: 10pt"> <input height="32" width="38" type="button" name="MS" value="MS" title="Memory store" onClick="memory(1)" style="BACKGROUND: #EEEEEE; FONT-SIZE: 10pt; HEIGHT: 32px; WIDTH: 38px"> </td> </TR> <TR> <TD style="font-family: Arial, Verdana; font-size: 10pt"> <INPUT HEIGHT="32" WIDTH="38" TYPE="button" NAME="4" VALUE="4" onClick="dodajBroj(4)" STYLE="BACKGROUND: #DEDEDE; FONT-SIZE: 12pt; HEIGHT: 32px; WIDTH: 38px"> </TD> <TD style="font-family: Arial, Verdana; font-size: 10pt"> <INPUT HEIGHT="32" WIDTH="38" TYPE="button" NAME="5" VALUE="5" onClick="dodajBroj(5)" STYLE="BACKGROUND: #DEDEDE; FONT-SIZE: 12pt; HEIGHT: 32px; WIDTH: 38px"> </TD> <TD style="font-family: Arial, Verdana; font-size: 10pt"> <INPUT HEIGHT="32" WIDTH="38" TYPE="button" NAME="6" VALUE="6" onClick="dodajBroj(6)" STYLE="BACKGROUND: #DEDEDE; FONT-SIZE: 12pt; HEIGHT: 32px; WIDTH: 38px"> </TD> <TD style="font-family: Arial, Verdana; font-size: 10pt"> <INPUT HEIGHT="32" WIDTH="38" TYPE="button" NAME="puta" VALUE="*" onClick="dodajBroj('*')" STYLE="BACKGROUND: #DEDEDE; FONT-SIZE: 12pt; HEIGHT: 32px; WIDTH: 38px"> </TD> <td style="font-family: Arial, Verdana; font-size: 10pt"> <input height="32" width="38" type="button" name="postotak" value="%" title="Percent" onClick="izracunaj(17)" style="BACKGROUND: #CDCDCD; FONT-SIZE: 10pt; HEIGHT: 32px; WIDTH: 38px"> </td> <td style="font-family: Arial, Verdana; font-size: 10pt"> <input height="32" width="38" type="button" name="MR" value="MR" title="Memory recall" onClick="memory(2)" style="BACKGROUND: #EEEEEE; FONT-SIZE: 10pt; HEIGHT: 32px; WIDTH: 38px"> </td> </TR> <TR> <TD style="font-family: Arial, Verdana; font-size: 10pt"> <INPUT HEIGHT="32" WIDTH="38" TYPE="button" NAME="1" VALUE="1" onClick="dodajBroj(1)" STYLE="BACKGROUND: #DEDEDE; FONT-SIZE: 12pt; HEIGHT: 32px; WIDTH: 38px"> </TD> <TD style="font-family: Arial, Verdana; font-size: 10pt"> <INPUT HEIGHT="32" WIDTH="38" TYPE="button" NAME="2" VALUE="2" onClick="dodajBroj(2)" STYLE="BACKGROUND: #DEDEDE; FONT-SIZE: 12pt; HEIGHT: 32px; WIDTH: 38px"> </TD> <TD style="font-family: Arial, Verdana; font-size: 10pt"> <INPUT HEIGHT="32" WIDTH="38" TYPE="button" NAME="3" VALUE="3" onClick="dodajBroj(3)" STYLE="BACKGROUND: #DEDEDE; FONT-SIZE: 12pt; HEIGHT: 32px; WIDTH: 38px"> </TD> <TD style="font-family: Arial, Verdana; font-size: 10pt"> <INPUT HEIGHT="32" WIDTH="38" TYPE="button" NAME="minus" VALUE="-" onClick="dodajBroj('-')" STYLE="BACKGROUND: #DEDEDE; FONT-SIZE: 12pt; HEIGHT: 32px; WIDTH: 38px"> </TD> <TD style="font-family: Arial, Verdana; font-size: 10pt"> <INPUT HEIGHT="32" WIDTH="38" TYPE="button" NAME="lijevo" VALUE="(" onClick="dodajBroj('(')" STYLE="BACKGROUND: #CDCDCD; FONT-SIZE: 10pt; HEIGHT: 32px; WIDTH: 38px"> </TD> <TD style="font-family: Arial, Verdana; font-size: 10pt"> <INPUT HEIGHT="32" WIDTH="38" TYPE="button" NAME="desno" VALUE=")" onClick="dodajBroj(')')" STYLE="BACKGROUND: #CDCDCD; FONT-SIZE: 10pt; HEIGHT: 32px; WIDTH: 38px"> </TD> </TR> <TR> <TD style="font-family: Arial, Verdana; font-size: 10pt"> <INPUT HEIGHT="32" WIDTH="38" TYPE="button" NAME="0" VALUE="0" onClick="dodajBroj(0)" STYLE="BACKGROUND: #DEDEDE; FONT-SIZE: 12pt; HEIGHT: 32px; WIDTH: 38px"> </TD> <TD style="font-family: Arial, Verdana; font-size: 10pt"> <INPUT HEIGHT="32" WIDTH="38" TYPE="button" NAME="." VALUE="." onClick="dodajBroj('.')" STYLE="BACKGROUND: #DEDEDE; FONT-SIZE: 12pt; HEIGHT: 32px; WIDTH: 38px"> </TD> <TD style="font-family: Arial, Verdana; font-size: 10pt"> <INPUT HEIGHT="32" WIDTH="38" TYPE="button" NAME="exp" VALUE="E" onClick="dodajBroj('e')" STYLE="BACKGROUND: #DEDEDE; FONT-SIZE: 10pt; HEIGHT: 32px; WIDTH: 38px"> </TD> <TD style="font-family: Arial, Verdana; font-size: 10pt"> <INPUT HEIGHT="32" WIDTH="38" TYPE="button" NAME="plus" VALUE="+" onClick="dodajBroj('+')" STYLE="BACKGROUND: #DEDEDE; FONT-SIZE: 12pt; HEIGHT: 32px; WIDTH: 38px"> </TD> <TD COLSPAN=2 style="font-family: Arial, Verdana; font-size: 10pt"> <INPUT HEIGHT="32" WIDTH="82" TYPE="button" NAME="enter" onClick="izracunaj(1)" VALUE="=" STYLE="BACKGROUND: #CDCDCD; FONT-SIZE: 12pt; HEIGHT: 32px; WIDTH: 83px"> </TD> </TR> </TABLE> </TD> </TR> </TABLE> </FORM>
__________________ Keep f***ing learning Ask for f***ing help. Use f***ing spell check. Think about all the f***ing possibilities. |
| ||||
__________________ Blog de Diseño Gráfico roc21.com || El secreto de la creatividad es saber esconder tus fuentes. |
| ||||
__________________ Blog de Diseño Gráfico roc21.com || El secreto de la creatividad es saber esconder tus fuentes. |