What does this mean? I cant work out whats wrong with my javascript. If anyone could help I would be very greatful.
| SitePoint Sponsor |

What does this mean? I cant work out whats wrong with my javascript. If anyone could help I would be very greatful.
You are calling a function or another object that doesn't exist.
Most common mistake: Calling a function, but getting the caps or name wrong.
What page is this on?

var width, height, x, y;
if(document.all)//for IE
{
width=document.body.clientWidth;
height=document.body.clientHeight;
}
else if (document.layers) //for NS
{
width=window.innerWidth;
height=window.innerHeight;
}
Can you upload the actual page so I can have a look and play around? You'd be surprised where the error might be![]()

Okay, but it will take about 15 mins

I've done it it's here Thankyou in advance
Here's the problem code (I've fixed some things, but I'm not sure where your various properties that I've commented out are coming from... It's probably the clientWidth and clientHeight that are producing the problems).Code:if (document.all) //for IE { // width=document.body.clientWidth; // height=document.body.clientHeight; }
Yeah, it is.

The problem is, that I need to find out how wide the inside of the window is so I can find out where the layer should go. I put up another post here asking how I could do it, and they gave me this code. What's funny is I tried it, and it worked, but when I put it in the page it stopped working.I don't know what's going on.
I've never seen clientWidth before, personally...


i gave him the clientwidth code, it works. i have used it before.
here is my little test script for it that i wrote awhile back..
Code:<html> <head> </head> <body> <script language="javascript"> if(document.all) { imgwidth=document.body.clientWidth; } else if(document.layers) { imgwidth=window.innerWidth; } imgwidth = imgwidth - 30 document.write("<img src='picture.gif' width='" + imgwidth +"' height='30'>") </script> </body> </html>
Some say the world will end in fire, Some say in ice.
From what I've tasted of desire
I hold with those who favor fire.
I dunno, might be cause it's in the head (this body isn't instantiated), just saying I've never seen it, hence I can't troubleshoot it![]()


i think you are right. i think being in the head of the document causes problems.Originally posted by Jeremy W.
I dunno, might be cause it's in the head (this body isn't instantiated)...
Some say the world will end in fire, Some say in ice.
From what I've tasted of desire
I hold with those who favor fire.

I'm having a look at it.![]()
Thanx D![]()

Hey
Thanks. I just put it in the body instead and now it's working. Thanks a lot. I've got to take it down now.
Marek

Sorry, I took so long, had a meeting.
Oh well, you got it.![]()
:gets jiggy wif it:


my god, are you still here.Originally posted by Jeremy W.
:gets jiggy wif it:
I guess the men in the white coats go lost on there way to get you.![]()
Some say the world will end in fire, Some say in ice.
From what I've tasted of desire
I hold with those who favor fire.
Bookmarks