SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    Skills to Pay the Bills Sparkie's Avatar
    Join Date
    Jul 1999
    Location
    A cave with 47 computers and an internet feed
    Posts
    3,559
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Object Expected.. *screams*

    I'm no Javascript expert... All I want to do is put a Tell a Friend script on a page here:

    www.momandpopmarketing.com/marketing/tellafriend

    But when I click the button, I get the yellow triangle of doom with Error on Page which tells me "Object Expected - line 122. So I go to line 122 and see the end center tag, and that doesn't help me one bit, of course... So now I turn to you all. What did I do wrong?

  2. #2
    SitePoint Member
    Join Date
    Sep 2006
    Posts
    3
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Sometimes the line # that the error gives you and the line # in your design/code program don't always match - the error could be on another line. Best of luck.

  3. #3
    SitePoint Zealot bensheard's Avatar
    Join Date
    Jun 2006
    Location
    Cape Town | South Africa
    Posts
    117
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi
    A couple of things i noticed when looking at the source code of the link above:
    1. There are some parts which look like they are supposed to be PHP - either you didnt save the page as .php or you need to have <?php ...... ?> - you have <? ........ ?>. I thought that that was supposed to work, but i always use <?php instead of <? anyway.
    2. On your "Click once to send" button, the onclick attribute's value if validate(); - firstly you dont need ; at the end - but im not sure if it makes a difference. And secondly, there is no function defined for validate() so that accounts for the Object Expected error. I have looked though all the external .js pages and there is defenitely no validate() function defined.

    Tell me if that works....
    Ben Sheard
    -------------
    Log all your dives easily and quickly from anywhere in the world
    www.divinglogs.cafe150.com


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
  •