SitePoint Sponsor

User Tag List

Results 1 to 19 of 19
  1. #1
    SitePoint Zealot Marek Bereza's Avatar
    Join Date
    Sep 2001
    Location
    London
    Posts
    129
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    "Object Required"?

    What does this mean? I cant work out whats wrong with my javascript. If anyone could help I would be very greatful.
    of the brethren of disco metal
    Disco metal tunes at www.wikid.co.uk

  2. #2
    SitePoint Wizard silver trophy Jeremy W.'s Avatar
    Join Date
    Jun 2001
    Location
    Toronto, Canada
    Posts
    9,123
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    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?
    SVP Marketing, SoCast SRM
    Personal blog: Strategerize
    Twitter: @jeremywright

  3. #3
    SitePoint Zealot Marek Bereza's Avatar
    Join Date
    Sep 2001
    Location
    London
    Posts
    129
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    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;
    }
    of the brethren of disco metal
    Disco metal tunes at www.wikid.co.uk

  4. #4
    SitePoint Wizard silver trophy Jeremy W.'s Avatar
    Join Date
    Jun 2001
    Location
    Toronto, Canada
    Posts
    9,123
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Can you upload the actual page so I can have a look and play around? You'd be surprised where the error might be
    SVP Marketing, SoCast SRM
    Personal blog: Strategerize
    Twitter: @jeremywright

  5. #5
    SitePoint Zealot Marek Bereza's Avatar
    Join Date
    Sep 2001
    Location
    London
    Posts
    129
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Okay, but it will take about 15 mins
    of the brethren of disco metal
    Disco metal tunes at www.wikid.co.uk

  6. #6
    SitePoint Zealot Marek Bereza's Avatar
    Join Date
    Sep 2001
    Location
    London
    Posts
    129
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I've done it it's here Thankyou in advance
    of the brethren of disco metal
    Disco metal tunes at www.wikid.co.uk

  7. #7
    SitePoint Wizard silver trophy Jeremy W.'s Avatar
    Join Date
    Jun 2001
    Location
    Toronto, Canada
    Posts
    9,123
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Code:
    if (document.all) //for IE
    	{
    //	width=document.body.clientWidth;
    //	height=document.body.clientHeight;
    	}
    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).
    SVP Marketing, SoCast SRM
    Personal blog: Strategerize
    Twitter: @jeremywright

  8. #8
    SitePoint Wizard silver trophy Jeremy W.'s Avatar
    Join Date
    Jun 2001
    Location
    Toronto, Canada
    Posts
    9,123
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Yeah, it is.
    SVP Marketing, SoCast SRM
    Personal blog: Strategerize
    Twitter: @jeremywright

  9. #9
    SitePoint Zealot Marek Bereza's Avatar
    Join Date
    Sep 2001
    Location
    London
    Posts
    129
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    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.
    of the brethren of disco metal
    Disco metal tunes at www.wikid.co.uk

  10. #10
    SitePoint Wizard silver trophy Jeremy W.'s Avatar
    Join Date
    Jun 2001
    Location
    Toronto, Canada
    Posts
    9,123
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    I've never seen clientWidth before, personally...
    SVP Marketing, SoCast SRM
    Personal blog: Strategerize
    Twitter: @jeremywright

  11. #11
    I am the night... bman's Avatar
    Join Date
    Mar 2001
    Location
    In a van... down by the river.
    Posts
    366
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    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.

  12. #12
    SitePoint Wizard silver trophy Jeremy W.'s Avatar
    Join Date
    Jun 2001
    Location
    Toronto, Canada
    Posts
    9,123
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    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
    SVP Marketing, SoCast SRM
    Personal blog: Strategerize
    Twitter: @jeremywright

  13. #13
    I am the night... bman's Avatar
    Join Date
    Mar 2001
    Location
    In a van... down by the river.
    Posts
    366
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally posted by Jeremy W.
    I dunno, might be cause it's in the head (this body isn't instantiated)...
    i think you are right. i think being in the head of the document causes problems.
    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.

  14. #14
    ALT.NET - because we need it silver trophybronze trophy dhtmlgod's Avatar
    Join Date
    Jul 2001
    Location
    Scotland
    Posts
    4,836
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I'm having a look at it.

  15. #15
    SitePoint Wizard silver trophy Jeremy W.'s Avatar
    Join Date
    Jun 2001
    Location
    Toronto, Canada
    Posts
    9,123
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Thanx D
    SVP Marketing, SoCast SRM
    Personal blog: Strategerize
    Twitter: @jeremywright

  16. #16
    SitePoint Zealot Marek Bereza's Avatar
    Join Date
    Sep 2001
    Location
    London
    Posts
    129
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    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
    of the brethren of disco metal
    Disco metal tunes at www.wikid.co.uk

  17. #17
    ALT.NET - because we need it silver trophybronze trophy dhtmlgod's Avatar
    Join Date
    Jul 2001
    Location
    Scotland
    Posts
    4,836
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Sorry, I took so long, had a meeting.

    Oh well, you got it.

  18. #18
    SitePoint Wizard silver trophy Jeremy W.'s Avatar
    Join Date
    Jun 2001
    Location
    Toronto, Canada
    Posts
    9,123
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    :gets jiggy wif it:
    SVP Marketing, SoCast SRM
    Personal blog: Strategerize
    Twitter: @jeremywright

  19. #19
    I am the night... bman's Avatar
    Join Date
    Mar 2001
    Location
    In a van... down by the river.
    Posts
    366
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally posted by Jeremy W.
    :gets jiggy wif it:
    my god, are you still here.
    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •