function gggg()
{
// gf.style.background-color = "red";
}
function change(){
var x = window.event.srcElement
var y = x.parentNode
y.style.backgroundColor = "red"
}
function change2(){
var x = window.event.srcElement
var y = x.parentNode
y.style.backgroundColor = "blue"
}
/*
<td id="abc_<%=i%>"> <%=cons.execute("select name from star where id="&rs("id"))("name")%></td>
*/
function bgc()
{
var tdcell = document.getElementById("gg");
tdcell.style.backgroundColor = "red";
}
var tb ;
function fill(x,y)
{
if(x>1)
{
return false;
}
if(y>5)
{
return false;
}
tb.rows[x].cells[y].style.backgroundColor = "red";
// var d =document.getElementById("cell0_0");
// d.style.backgroundColor = "#545545";
}
function beginFill(x,y)
{
var cell = window.event.srcElement;
tb = cell.parentElement.parentElement;
floodFill(x,y);
}
function alreadyFill(x,y)
{
if(x>1)
{
return false;
}
if(y>5)
{
return false;
}
if(tb.style.backgroundColor =="red")
{
return true;
}
return false;
}
function floodFill(x,y)
{
if(alreadyFill(x,y)) return;
fill(x,y);
//consider the edge
floodFill(x, y-1);
floodFill(x+1, y );
floodFill(x, y+1);
floodFill(x-1, y );
// x=x+1;
// y=y+1;
}
//////extreamly important
function ay()
{
var x=3;
var y =4;
var stack=[];
stack.push([x,y]);
stack.push([x-1,y]);
toFill = stack.pop();// stack.pop can split automatically now toFill will be an array
alert(toFill[0]+'\n'+toFill[1]);
}
function thisYear()
{
d =new Date();
// d = 2000;
alert(d.getFullYear());
}
//avoid 2000 2001
RightNow = new Date();
var TheYear = RightNow.getYear()
alert(TheYear);
if (TheYear >= 100 && TheYear <= 1999)
{TheYear=TheYear + 1900}
else
{TheYear=TheYear}
document.write("The year is " + TheYear + ". ")
/*
But I Want Both Effects
Okay, how do you think you'd do that? Let's think it through:
Common sense would suggest you write two onMouseOver commands. Let's try that.
The two commands are not separate from each other. We want them to occur at the same time
so we cannot separate them using a semicolon because we know a semicolon is a statement terminator.
New Rule: Use a comma when separating multiple JavaScript events.
And what about all those pesky quotes? Remember, the quotes go around single items like text. Well,
we want these two onMouseOver commands to happen as one so we only need quotes at the very beginning of the first one
and the very end of the second one. That way the quotes surround it all, showing it to the browser as if it's one event. With me?
We'll probably still need the single quotes though...
Here's what we got...
<A HREF="http://www.htmlgoodies.com"
onMouseOver="document.bgColor='pink',
onMouseOver=window.status='Go to the Goodies Home Page';
return true">Click Here</A>
*/

浙公网安备 33010602011771号