el problema grave q tengo con este javascript es q lo kiero hacerlo aleatorio
tonces peske otro script con random, pero el problema es q al poner el tipico
documen.write('')
tengo el problema de las comillas chicas
pk el script tb tiene comillas chicas, tonces como lo hago pa poner esta linea
document.write('<body onLoad=\"MM_goToURL( 'top' , 'template' );return ocument.MM_returnValue\">
donde 'template' es el valor q devuelve la funcion este de este codigo random
Código:
function cambiohtml()
var templates = 3;
var ahora = new Date()
var segundos = ahora.getSeconds()
var ad = segundos % templates;
ad +=1;
if (ad==1) {
template="template1.php"
}
if (ad==2) {
template="template2.php"
}
if (ad==3) {
template="template3.php"
}
si alguien lo kiero hacer de otra forma aki esta el script normal
(osea simple, no aleatorio)
Código:
<HTML><HEAD>
<script language="JavaScript" type="text/JavaScript">
function MM_goToURL() {
var i, args=MM_goToURL.arguments; document.MM_returnValue = false;
for (i=0; i<(args.length-1); i+=2) eval(args[i]+".location='"+args[i+1]+"'");
}
</script>
<TITLE> Cargando... </TITLE>
<link rel="stylesheet" type="text/css" href="a.css">
</HEAD>
<body onLoad="MM_goToURL('top','index2.htm');return document.MM_returnValue">
<table align="center" width="100%" heigth="100%">
<tr><td valign="middle">
Cargando...
</td></tr></table>
<p ></p>
</BODY></HTML>