Robert,
Many thanks for your help.
Cheers,
Claudio
> Hi Claudio,
I'm fine, and I hope you're ok as well.
Regarding your questions:
>1 - is it possible to call two functions from the onload event?
Yes, this is the syntax to call two functions:
<body onload=3D"doIt('test', 5); testTrue()">
>2 - is it possible to set the target using code??
Are you trying to change the location in a different frame than the one
you're in?
In that case:
parent.main.location.href =3D "http://www.google.com"
/Robert
-----Ursprungligt meddelande-----
Fr=E5n: Claudio Pallone [mailto:pallone@l...]=20
Skickat: den 16 oktober 2002 16:12
Till: JavaScript HowTo
=C4mne: [javascript_howto] Re: SV: CHECK FOR NULL VALUE
Hi Robert,
Just two questions?
1 - is it possible to call two functions from the onload event?
<body onload=3D"doIt('test', 5)"; "testTrue()";>
2 - is it possible to set the target using code??
I know we can use the location.href =3D "test.htm" to create a link but
what=20
about the target?? how do I set it?? this does not work:
location.href =3D "test.htm target=3D'main'";
Cheers,
Claudio
> Hi Claudio,
I don't think that it regards the TABLE element as null.
parent.frames[1].rightBottom.document.getElementsByTagName("table") =
!=3D3D
null
Just check for :
parent.frames[1].rightBottom.document.getElementsByTagName("table")
or perhaps:
if(typeof
parent.frames[1].rightBottom.document.getElementsByTagName("table") =3D
=3D3D=3D3D
"object")
If this doesn't work, create a variable in the other frame that is set
to true when the page is fully loaded. As in:
<html>
<head>
<title>A title</title>
<script language=3D3D"JavaScript" type=3D3D"text/javascript">
var bIsLoaded =3D3D false;
window.onload =3D3D function (){
bIsLoaded =3D3D true;
}
</script>
</head>
<body>
</body>
</html>
And then change:
if(parent.frames[1].rightBottom.document.getElementsByTagName("table")
!=3D3D null) {
to:
if(bIsLoaded)
/Robert
-----Ursprungligt meddelande-----
Fr=3DE5n: Pallone, Claudio [KMR-SPC]
[mailto:Claudio.Pallone@k...]=3D20
Skickat: den 16 oktober 2002 15:55
Till: JavaScript HowTo
=3DC4mne: [javascript_howto] CHECK FOR NULL VALUE
Hi,
Two weeks ago Robert showed me how to create a function that would
highlight the <td>s of a table according to some criteria. This works
wonderfully well.
However, since I am using frames, I have to make sure that all the
frames are loaded. If the user clicks on the highlight button before the
bottom frame is loaded then I get an alert saying that the bottom frame
is null.
I have tried to use an "if" statement to check if the frame is null but
it is not working.
Any ideas why this "if" statement is not working?
Cheers,
var bColoredTDs =3D3D false;
function HighlightIndexTD()
{
if(parent.frames[1].rightBottom.document.getElementsByTagName("table")
!=3D3D null) {
var arrTables =3D3D
parent.frames[1].rightBottom.document.getElementsByTagName("table");
for(var i=3D3D0; i<arrTables.length; i++)
{
if(i > 0)
{
var arrAllCurrentTableRows =3D3D
arrTables[i].getElementsByTagName("tr");
for(var j=3D3D0; j<arrAllCurrentTableRows.length;
j++)
{
var oAllCells =3D3D
arrAllCurrentTableRows[j].getElementsByTagName("td");
with(oAllCells[oAllCells.length - 1])
{
var intValue =3D3D
parseInt(innerHTML, 10);
if(!bColoredTDs && (intValue <
80 || intValue > 120))
{
style.color =3D3D "white";
style.backgroundColor
=3D3D
(intValue < 80)? "blue" : "red";
}
else
{
style.color =3D3D "black";
style.backgroundColor
=3D3D
"white";
}
}
}
}
}
bColoredTDs =3D3D (bColoredTDs)? false : true;
else
{
alert("Choose a Report");
}
}
BMRB International=3D20
http://www.bmrb.co.uk +44 (0)20 8566 5000
____________________________________________________________
This message (and any attachment) is intended only for the recipient and
may contain confidential and/or privileged material. If you have
received this in error, please contact the sender and delete this
message immediately. Disclosure, copying or other action taken in
respect of this email or in reliance on it is prohibited. BMRB
International Limited accepts no liability in relation to any personal
emails, or content of any email which does not directly relate to our
business.
---
Improve your web design skills with these new books from Glasshaus.
Usable Web Menus
http://www.amazon.com/exec/obidos/ASIN/1904151027/ref=3D3Dnosim/theprogra=
m
m=3D
e
r-20
Constructing Accessible Web Sites
http://www.amazon.com/exec/obidos/ASIN/1904151000/ref=3D3Dnosim/theprogra=
m
m=3D
e
r-20
Practical JavaScript for the Usable Web
http://www.amazon.com/exec/obidos/ASIN/1904151051/ref=3D3Dnosim/theprogra=
m
m=3D
e
r-20
---
Change your mail options at http://p2p.wrox.com/manager.asp or=3D20 to
unsubscribe send a blank email to
---
Improve your web design skills with these new books from Glasshaus.
Usable Web Menus
http://www.amazon.com/exec/obidos/ASIN/1904151027/ref=3Dnosim/theprogramm=
e
r-20
Constructing Accessible Web Sites
http://www.amazon.com/exec/obidos/ASIN/1904151000/ref=3Dnosim/theprogramm=
e
r-20
Practical JavaScript for the Usable Web
http://www.amazon.com/exec/obidos/ASIN/1904151051/ref=3Dnosim/theprogramm=
e
r-20
---
Change your mail options at http://p2p.wrox.com/manager.asp or=20
to unsubscribe send a blank email to