Web Analytics Made Easy -
StatCounter 2 actions off of 1 link - JavaScript error - CodingForum

Announcement

Collapse
No announcement yet.

2 actions off of 1 link - JavaScript error

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • 2 actions off of 1 link - JavaScript error

    I do believe that I am in the right forum for this. If not, I apologize.

    I have this website I've been working on and unfortunately I've run into a problem: everytime I click a button, the JavaScript Console pops up. I assume this is because I've done something wrong. What I want to do is to have two seperate iFrames load different content when the user clicks a button. For instance, this is what I have for one of the links:

    <a href="javascript:" onclick="parent.frames['right_body'].location = 'http://boomspeed.com/nateproject/booking.htm'; parent.frames['left_body'].location = 'http://boomspeed.com/nateproject/emailselection.htm';"><IMG SRC="http://www.boomspeed.com/nateproject/button_email.jpg" ALT="" WIDTH=89 HEIGHT=24 border="0"></a>

    However, I do not have anything in my <head>, and I assume that is the problem. If this is not the problem, feel free to point me in the right direction as well.

    EDIT: I just read the FAQ section, which made me realize "javascript:" isn't the best way to go. Is there an alternative way for me to make this work?
    Last edited by Elegiac; Jul 30, 2005, 12:38 AM.

  • #2
    Try this
    Code:
    <a href="http://boomspeed.com/nateproject/booking.htm" target="right_body" onclick="parent.frames['left_body'].location = 'http://boomspeed.com/nateproject/emailselection.htm';"><img src="http://www.boomspeed.com/nateproject/button_email.jpg" alt="" width="89" height="24" border="0"></a>
    This way if the user has javascript disabled they will at least see one page. If the link is inside of an iframe then, do something like this
    Code:
    <a href="http://boomspeed.com/nateproject/booking.htm" target="right_body" onclick="parent.frames['right_body'.location=this.href;parent.frames['left_body'].location = 'http://boomspeed.com/nateproject/emailselection.htm';return false"><img src="http://www.boomspeed.com/nateproject/button_email.jpg" alt="" width="89" height="24" border="0"></a>
    ||||If you are getting paid to do a job, don't ask for help on it!||||

    Comment


    • #3
      I tried that, but unfortunately it messed up my layout. The button is now a little higher than the rest of the buttons and therefore screws up everything.

      Comment


      • #4
        I made no real change to the way you had it before. I added quotes where necessary. Not sure why it won't work. Sighs if you must, use javascript:; with a semicolon rather than javascript: without it.
        ||||If you are getting paid to do a job, don't ask for help on it!||||

        Comment


        • #5
          Well I've decided just to redo the site another way. I appreciate your help a lot though, or else I'd still be trying to fix my older problems.

          Thanks again.

          Comment

          Working...
          X