#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2003
    Location
    Las Vegas, NV
    Posts
    2
    Rep Power
    0

    Onclick/Javascript Error


    Hello,

    I'm trying to allow someone to click anywhere in a column of a table and be forwarded to a url but I keep getting an error.

    The wierdest thing is that the code works correctly. If you click anywhere in the column it sends the user to the correct page without any errors. However, when you click back on the browser and view the page again you can see the javascript error message in the bottom left-hand corner of IE.

    The code I'm using is shown below.

    PHP Code:
    <td width="195" height="100" class="hmplanstd" onMouseOver="this.className='hmplanstdovr'" onMouseOut="this.className='hmplanstd'" onClick="location.href='plans.php?plan=1'">blah</td
    Everything above is posted so you can see all of the code however the only portion that is giving me problems is the OnClick event.

    Do you know why it would work correctly but then when you go back to the page it doesn't? (Well, it does, you just have the error in the browser. You can click on the link again and it'll still work.)
    Last edited by jstrellner; May 17th, 2003 at 08:08 AM.
  2. #2
  3. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2003
    Posts
    29
    Rep Power
    0
    that code is fine. have you got any other js code on the page?

    IE is weird with js errors. If your page contains a js error it will only diplay it if you return to your page using the forward button or back button. This only occurs in some versions of IE and only occurs for some errors!

    Using your back buton return to the page. double click on the yellow error at bottom left of screen and see what line number it refers to.

    have you got a url?
  4. #3
  5. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2003
    Location
    Las Vegas, NV
    Posts
    2
    Rep Power
    0
    Originally posted by ocallagh
    that code is fine. have you got any other js code on the page?

    IE is weird with js errors. If your page contains a js error it will only diplay it if you return to your page using the forward button or back button. This only occurs in some versions of IE and only occurs for some errors!

    Using your back buton return to the page. double click on the yellow error at bottom left of screen and see what line number it refers to.

    have you got a url?
    No, I don't have a url. The site is still in development.

    However, I just tried it again and it didn't give me the error! I'm confused now.

    Oh well. One more semi related question if the user has javascript disabled or it doesn't support it will it still work? I disabled all scripting and it was still working.

    ocallagh, thanks for the help.

IMN logo majestic logo threadwatch logo seochat tools logo