Autor Tema: trucos para webmasters  (Leído 26608 veces)

Desconectado diSHITal

  • Member
  • ***
  • Mensajes: 122
    • http://spaces.msn.com/members/5minDK
trucos para webmasters
« en: 28 de Septiembre de 2003, 10:23:12 pm »
Aqui van algunos truquitos para los que quieran hacerse una página web...:
* No permite utilizar el botón derecho y no aparece nada (ni alert, etc)
----------------------------------------------------------------------------------
<script language="Javascript">
<!-- Begin
document.oncontextmenu = function(){return false}
// End -->
</script>
----------------------------------------------------------------------------------

*No permite seleccionar el contenido de una página
----------------------------------------------------------------------------------
<script language="Javascript">
<!-- Begin
function disableselect(e){
return false
}
function reEnable(){
return true
}
document.onselectstart=new Function ("return false")
if (window.sidebar){
document.onmousedown=disableselect
document.onclick=reEnable
}
// End -->
</script>
----------------------------------------------------------------------------------

*Por si hay algún error en la página
----------------------------------------------------------------------------------
<SCRIPT language=JavaScript>
function blockError(){return true;}
window.onerror = blockError;
</SCRIPT>
----------------------------------------------------------------------------------
*Para esconder la URL en el navegador (Utilizar un frame del 100%). De esta manera siempre se mostrará miweb.com y no miweb.com/algo.htm
----------------------------------------------------------------------------------
<HEAD>
<TITLE>Página Incial - wwww.miweb.com</TITLE>
</HEAD>
<FRAMESET rows="100%" BORDER=0 FRAMEBORDER=0 FRAMESPACING=0>
<FRAME NAME="top" SRC="http://www.miweb.com" NORESIZE></FRAMESET>
----------------------------------------------------------------------------------
*No permite el botón derecho y además te penaliza con 10 clicks
----------------------------------------------------------------------------------
<script language="Javascript">
zaehler=0;
 function right(e) {
 if (navigator.appName == 'Netscape'){
 if (e.which == 3 || e.which == 2){
 alert("Aqui no puedes utilizar el botón derecho del mouse");
 for(i=0;i!=zaehler;i++)alert("Ya te avisé, te penalizaré con \n                 "+(zaehler-i)+"\n              clicks.");
 zaehler+=10;
 alert("¡La proxima vez que lo hagas será peor! www.miweb.com");
 return false;}}
 if (navigator.appName == 'Microsoft Internet Explorer'){
 if (event.button == 2 || event.button == 3){
 alert("Aqui no puedes utilizar el botón derecho del mouse");
 for(i=0;i!=zaehler;i++)alert("Ya te avisé, te penalizaré con \n                 "+(zaehler-i)+"\n              clicks.");
 zaehler+=10;
 alert("¡La proxima vez que lo hagas será peor! www.miweb.com");
 return false;}}
 return true;
 }
 document.onmousedown=right;
 if (document.layers) window.captureEvents(Event.MOUSEDOWN);
 window.onmousedown=right;
 // --></script>
----------------------------------------------------------------------------------
*Para que el cursor sea un punto de mira (en pequeñito)
----------------------------------------------------------------------------------
<style type="text/css">
<!--
body {  cursor: crosshair}
-->
</style>
----------------------------------------------------------------------------------
*Te dice el dia, mes y año del PC

<script language="JavaScript"><!--
var hoy = new Date();
dia = hoy.getDate();
mes = hoy.getMonth();
ano = hoy.getYear() + 0000;
if (mes == "0") nombremes = "<font color=#00FF00 size=2>Enero</font>";
   else if (mes == "1") nombremes = "<font color=#00FF00 size=2>Febrero</font>";
   else if (mes == "2") nombremes = "<font color=#00FF00 SIZE=2>Marzo</font>";
   else if (mes == "3") nombremes = "<font color=#00FF00 SIZE=2>Abril</font>";
   else if (mes == "4") nombremes = "<font color=#00FF00 SIZE=2>Mayo</font>";
   else if (mes == "5") nombremes = "<font color=#00FF00 SIZE=2>Junio</font>";
   else if (mes == "6") nombremes = "<font color=#00FF00 SIZE=2>Julio</font>";
   else if (mes == "7") nombremes = "<font color=#00FF00 SIZE=2>Agosto</font>";
   else if (mes == "8") nombremes = "<font color=#00FF00 SIZE=2>Septiembre</font>";
   else if (mes == "9") nombremes = "<font color=#00FF00 SIZE=2>Octubre</font>";
   else if (mes == "10") nombremes = "<font color=#00FF00 SIZE=2>Noviembre</font>";
   else nombremes = "<font color=#00FF00 SIZE=2>Diciembre</font>";
document.write (dia);
document.write (" de ");
document.write (nombremes);
document.write (" del ");
document.write (ano);
// --></script>
----------------------------------------------------------------------------------
*Cerrar la ventana al cabo de X rato
----------------------------------------------------------------------------------
<script language="javascript">setTimeout("self.close();",7000)</script>
----------------------------------------------------------------------------------
*Un texto va siguiendo el puntero del ratón
----------------------------------------------------------------------------------
<head>
<style>
.spanstyle {
   position:absolute;
   visibility:visible;
   top:-50px;
   font-size:9pt;
   font-family:Tahoma;
      font-weight:bold;
   color:blue;
}
</style>
<script>


var x,y
var step=20
var flag=0

// Tienes que dejar un espacio al final de tu mensaje!!!!!
var message="Tu mensaje va aqui... "
message=message.split("")

var xpos=new Array()
for (i=0;i<=message.length-1;i++) {
   xpos=-50
}

var ypos=new Array()
for (i=0;i<=message.length-1;i++) {
   ypos=-50
}

function handlerMM(e){
   x = (document.layers) ? e.pageX : document.body.scrollLeft+event.clientX
   y = (document.layers) ? e.pageY : document.body.scrollTop+event.clientY
   flag=1
}

function makesnake() {
   if (flag==1 && document.all) {
       for (i=message.length-1; i>=1; i--) {
            xpos=xpos[i-1]+step
         ypos=ypos[i-1]
       }
      xpos[0]=x+step
      ypos[0]=y
   
      for (i=0; i<message.length-1; i++) {
          var thisspan = eval("span"+(i)+".style")
          thisspan.posLeft=xpos
         thisspan.posTop=ypos
       }
   }
   
   else if (flag==1 && document.layers) {
       for (i=message.length-1; i>=1; i--) {
            xpos=xpos[i-1]+step
         ypos=ypos[i-1]
       }
      xpos[0]=x+step
      ypos[0]=y
   
      for (i=0; i<message.length-1; i++) {
          var thisspan = eval("document.span"+i)
          thisspan.left=xpos
         thisspan.top=ypos
       }
   }
      var timer=setTimeout("makesnake()",30)
}

</script>
</head>
----------------------------------------------------------------------------------

bueno, por ahora es todo.......no quiero ser pesado con el tema....mis saludos......... :twisted:
http://www.hackeando.com/gifs/logomini.gif
Lo unico que se es que nose nada
Te saluda el yo que existe en tu mente

Desconectado diSHITal

  • Member
  • ***
  • Mensajes: 122
    • http://spaces.msn.com/members/5minDK
mas trucos
« Respuesta #1 en: 30 de Septiembre de 2003, 07:25:08 am »
sigo sigo...jeje:
*Código JavaScript para que aparezca un alert al utilizar el botón derecho
-----------------------------------------------------------------------------------
<script language="JavaScript">
<!-- Begin
function right(e) {
var msg = "  [ www.miweb.com ] ";
if (navigator.appName == 'Netscape' && e.which == 3) {
alert(msg);  // Delete this line to disable but not alert user
return false;
}
else
if (navigator.appName == 'Microsoft Internet Explorer' && event.button==2) {
alert(msg); // Delete this line to disable but not alert user
return false;
}
return true;
}
document.onmousedown = right;
// End -->
</script>
-----------------------------------------------------------------------------------
*Se abre una ventana al utilizar el botón derecho
-----------------------------------------------------------------------------------
<SCRIPT language=JavaScript>
function right(e) {
if (navigator.appName == 'Netscape' && (e.which == 3 || e.which == 2)) {
   a=window.open("http://www.elhacker.net/","WindowName","width=640,height=600,top=40,left=50,resizable=yes,scrollbars=yes,menubar=no,toolbar=no,status=no,location=no");
   return false;
}
else if (navigator.appName == 'Microsoft Internet Explorer' && (event.button == 2 || event.button == 3)) {
   a=window.open("http://www.elhacker.net/","WindowName","width=640,height=600,top=40,left=50,resizable=yes,scrollbars=yes,menubar=no,toolbar=no,status=no,location=no");
   return false;
}
return true;
}
document.onmousedown=right;
window.onmousedown=right;
</SCRIPT>
-----------------------------------------------------------------------------------
*Para páginas con frames, no permite ver sólo un frame sino los dos frames o más juntos. (Colocar el código en cada frame)
-----------------------------------------------------------------------------------
<script LANGUAGE="JavaScript">
<!--
if (top == self) self.location.href = "http://www.miweb.com";
// -->
</script>
-----------------------------------------------------------------------------------
*Para webs sin frames, mantiene tu página en primer plano, y no puede estar en frames de otro "listillo"
-----------------------------------------------------------------------------------
<SCRIPT LANGUAGE="JavaScript">
<!--- Se esconde el codigo a navegadores sin JS
if (window != window.top)
top.location.href = location.href;
// -->
</SCRIPT>
-----------------------------------------------------------------------------------
*Variación del anterior
-----------------------------------------------------------------------------------
<SCRIPT LANGUAGE="Javascript">
<!---
if (parent.frames.length)
top.location.href= document.location;
// --->
</SCRIPT>
-----------------------------------------------------------------------------------
                          Personalización de la Web
*Para hacer la Página de Inicio
-----------------------------------------------------------------------------------
<a href="#" onClick="this.style.behavior='url(#default#homepage)';this.setHomePage('http://www.miweb.com');return false">Página de inicio</a>
-----------------------------------------------------------------------------------
*Añadir a Favoritos
-----------------------------------------------------------------------------------
<SCRIPT LANGUAGE="JavaScript">
   <!--
   function addBookmark()
   {
     if (window.external)
       external.AddFavorite("http://www.miweb.com", "H a c k i n g w i t h d i S H I T a l")
     else
       alert("Tu navegador no soporta esta caracteristica");
   }
   // -->
   </SCRIPT>
-----------------------------------------------------------------------------------
*Cambiar las barras de scroll (colocar siempre en el style) (puedes hacer infinitas variaciones cambiando color, tamaño, etc)
-----------------------------------------------------------------------------------
<style>
<!--
BODY { scrollbar-base-color : #000000;
    scrollbar-arrow-color : #FFFFFF; }
    .nav {
    color : #FFCC00;
    font-size : 8pt;}
-->
</style>
-----------------------------------------------------------------------------------
*Otro ejemplo:
-----------------------------------------------------------------------------------
<STYLE type=text/css>BODY {
   SCROLLBAR-FACE-COLOR: #333333; SCROLLBAR-HIGHLIGHT-COLOR: #444444; SCROLLBAR-SHADOW-COLOR: #111111; SCROLLBAR-3DLIGHT-COLOR: #333333; SCROLLBAR-ARROW-COLOR: #ffffce; SCROLLBAR-TRACK-COLOR: #000000; SCROLLBAR-DARKSHADOW-COLOR: black
}
</STYLE>

                   Escribir en el "Status" del Navegador y hacer mover el "Title"
-----------------------------------------------------------------------------------
*Que se vaya moviendo las palabras del status
-----------------------------------------------------------------------------------
<SCRIPT languague="JavaScript">
<!--
 var cuenta=0
 var texto=" Lo que te de la gana "
 function scrolltexto () {
 window.status=texto.substring (cuenta,texto.length)+  texto.substring(0,cuenta)
 if (cuenta <texto.length){ cuenta ++
 }else{
 cuenta=0
 }
 setTimeout("scrolltexto()",150)
 }
 scrolltexto ()
//-->
</SCRIPT>
-----------------------------------------------------------------------------------
*Te enseña la hora y el texto que quieras en la barra del status
-----------------------------------------------------------------------------------
<script language="JavaScript">
<!--
mensaje="  |======|  .: m i w e b . c o m :. "
function hora() {      
        var h = new Date();   
        window.status="|======|  "
        + h.getHours() +":"+ h.getMinutes() +"" +mensaje ;
        window.setTimeout('hora()',100);        
}
hora()
//-->
</script>
-----------------------------------------------------------------------------------
*Varias frases o texto desplanzadose por el status
-----------------------------------------------------------------------------------
<head>
<SCRIPT>

<!--


var ShowString = "                                          " //La primera linea tiene que estar en blanco

               + "Aquí la frase 1                           " //Puedes añadir mas frases, aparte de estas 3

               + "Aquí la frase 2                           "

               + "Aquí la frase 3                           "
               
               + "Ejemplo de otra frase                     "

var ShowWidth  = 100

var ShowHead   = 0

var ShowTail   = ShowWidth

var ShowLength = ShowString.length


function Marquee ()

   {

   var DisplayString

   if (ShowHead < ShowTail)

     DisplayString = ShowString.substring(ShowHead, ShowTail)

   else

     DisplayString = ShowString.substring(ShowHead, ShowLength)

                   + ShowString.substring(       0, ShowTail)


   ShowHead = (ShowHead + 1 ) % ShowLength

   ShowTail = (ShowTail + 1 ) % ShowLength


   window.status = DisplayString


   TimerID = setTimeout("Marquee()", 100) //Cambia el numero para cambiar la velocidad

   }

//-->

</SCRIPT>
</head>
-----------------------------------------------------------------------------------
*Escribir en "Title" y hacer que se maya moviendo cada X segundos.
-----------------------------------------------------------------------------------
<SCRIPT LANGUAGE="JavaScript">
var txt="                              lo que quieras            -                            wwww.miweb.com -";
var espera=200;
var refresco=null;
function rotulo_title() {
        document.title=txt;
        txt=txt.substring(1,txt.length)+txt.charAt(0);
        refresco=setTimeout("rotulo_title()",espera);}
rotulo_title();
</SCRIPT>
-----------------------------------------------------------------------------------
*Terremoto (que la pantalla tiemble y se mueva)
-----------------------------------------------------------------------------------
<!-- para llamarlo con un botón-->
<INPUT onclick=shake(40) type=button value=""Terremoto"">
<SCRIPT language=JavaScript1.2>
<!-- Begin
function shake(n) {
if (n==1)
   {document.body.bgColor = "#0000DA";
   }
else
   {document.body.bgColor = "#FF8C00"
   }

if (self.moveBy) {
for (i = 15; i > 0; i--) {
for (j = n; j > 0; j--) {
self.moveBy(0,i);
self.moveBy(i,0);
self.moveBy(0,-i);
self.moveBy(-i,0);
         }
      }
   }
  }
// End -->
</SCRIPT>
-----------------------------------------------------------------------------------
bueno, eso es por ahora, se vemos..........salu2..... :twisted:
http://www.hackeando.com/gifs/logomini.gif
Lo unico que se es que nose nada
Te saluda el yo que existe en tu mente

 

Aviso Legal | Política de Privacidad | Política de Cookies

el contenido de la web se rige bajo licencia
Creative Commons License