Slide 16
Slide 16 text
Several new concepts arise here, so I'll go over each one of the
Several new concepts arise here, so I'll go over each one of them.
m.
the "status" refers to
the "status" refers to window.status
window.status, which is how you write to the status bar.
, which is how you write to the status bar.
Note that instead of calling a function, we called directly two
Note that instead of calling a function, we called directly two JavaScript statements
JavaScript statements
inside the event handler :"status='Do not click here, its
inside the event handler :"status='Do not click here, its empty!';return
empty!';return true" This is ok,
true" This is ok,
but you must separate multiple statements with a semicolon (;).
but you must separate multiple statements with a semicolon (;). You could have,
You could have,
alternatively, written everything up until "return true" as a fu
alternatively, written everything up until "return true" as a function and then calling it:
nction and then calling it:
function
function writestatus
writestatus(){
(){
status="Do not click here, its empty!"
status="Do not click here, its empty!"
}
}
and then:
and then:
onmouseover
onmouseover="
="writestatus();return
writestatus();return true"
true"
So you're thinking, "what is return true?" Good question. You ne
So you're thinking, "what is return true?" Good question. You need to add this line of
ed to add this line of
code to set the status property with the
code to set the status property with the mouseover
mouseover effect. Uh? I know, don't worry so
effect. Uh? I know, don't worry so
much now, it really isn't important. Just remember you need this
much now, it really isn't important. Just remember you need this to "activate" the
to "activate" the
status
status onmouseover
onmouseover effect.
effect.
onmouseout
onmouseout="status=' '" clears the status after the mouse leaves the link.
="status=' '" clears the status after the mouse leaves the link. Whenever
Whenever
the mouse moves away from the link, the status bar is "reset" ag
the mouse moves away from the link, the status bar is "reset" again. If you don't insert
ain. If you don't insert
this code, the status bar will still have those words you entere
this code, the status bar will still have those words you entered into it even after taking
d into it even after taking
away the cursor.
away the cursor.
Whenever we have nested quotations, the inner ones are always si
Whenever we have nested quotations, the inner ones are always singled.
ngled. Ie
Ie:
:
onclick
onclick="
="alert('hello
alert('hello')"
')"
onMouseover, onMouseout