Results 1 to 15 of 15

Thread: IE and Javascript issue with onclick event *** [RESOLVED] ***

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Nov 2001
    Posts
    76

    IE and Javascript issue with onclick event *** [RESOLVED] ***

    I have a web site that has an inline frame and in this inline frame are three dynamic links. Each dynamic link fires a new windows containing the link. The problem is the that after the link is clicked and the page is displayed IE jams the original page off teh browser window and you can only see the bottom portion. Is there any way to stop this behavior.

    It does not happen in NS.
    Last edited by scimini; Feb 20th, 2004 at 12:02 PM.

  2. #2
    Frenzied Member vbNeo's Avatar
    Join Date
    May 2002
    Location
    Jutland, Denmark
    Posts
    1,994

    Re: IE and Javascript issue with onclick event

    Originally posted by scimini
    I have a web site that has an inline frame and in this inline frame are three dynamic links. Each dynamic link fires a new windows containing the link. The problem is the that after the link is clicked and the page is displayed IE jams the original page off teh browser window and you can only see the bottom portion. Is there any way to stop this behavior.

    It does not happen in NS.
    Does it jam what's inside the Iframe ? And how does your 'dynamic link' code look ?
    "Lies, sanctions, and cruise missiles have never created a free and just society. Only everyday people can do that."
    - Zack de la Rocha


    Hear me roar.

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Nov 2001
    Posts
    76
    Code:
    document.write("<a href=# onClick=response=false;window.open('LinksPage.html?ID=" + eval(Links) + "','linkwindow','width=800,height=588,scrollbars=no')><img border=0 src=images/Links/" + Links + "_Off.jpg onmouseover=document.images[1].src='images/Links/" + Links + "_On.jpg' onmouseout=document.images[1].src='images/Links/" + Links + "_Off.jpg' alt='" + Description[Links] + "'></a>")
    The Iframe contains a page that acts like scroller scrolling through links, when you click on the link it opens a new window display the link.

    Not just the iframe jams off the browser but the entire page. It appears to jump up to the iframe that the link scroller was displayed in.

  4. #4
    Frenzied Member vbNeo's Avatar
    Join Date
    May 2002
    Location
    Jutland, Denmark
    Posts
    1,994
    hmm weird...

    - What does the response=false do ?
    "Lies, sanctions, and cruise missiles have never created a free and just society. Only everyday people can do that."
    - Zack de la Rocha


    Hear me roar.

  5. #5

    Thread Starter
    Lively Member
    Join Date
    Nov 2001
    Posts
    76
    I thought it was suppose to ignore the click event and just process the onclick.

    I tried it in Netscape and it worked properly.

  6. #6
    Hyperactive Member bsw2112's Avatar
    Join Date
    Nov 2001
    Location
    ottawa, canada
    Posts
    292
    can you provide a link to that page?

    i am unsure what you mean

    to cancel links you would do this

    Code:
    <a href="http://www.vbforums.com" onClick="javascript:window.open('','win','width=200,height=200');return false;">open</a>
    see what happens when you take the stuff in bold out

    bsw

  7. #7

    Thread Starter
    Lively Member
    Join Date
    Nov 2001
    Posts
    76
    The page is in development and not on the web.

    I removed the bold text part and the still jumped but the link did not open.

  8. #8

    Thread Starter
    Lively Member
    Join Date
    Nov 2001
    Posts
    76
    I have a little more information.

    The page jumps up to the iframe that the click event was registered. In short the Iframe nows becomes topmargin=0 instead of default.html

  9. #9
    Hyperactive Member bsw2112's Avatar
    Join Date
    Nov 2001
    Location
    ottawa, canada
    Posts
    292
    can you create a dummy page of this?
    i have a hard time understand your problem

    the code i showed you (the return false) was to demonstrate how you can canel an action, in this case it was the href..

    cheers

    bsw

  10. #10

    Thread Starter
    Lively Member
    Join Date
    Nov 2001
    Posts
    76
    I did use the Return False on another page and it solved the problem but for some reason it does not work on this particular page. I will create a dummy page.

  11. #11

    Thread Starter
    Lively Member
    Join Date
    Nov 2001
    Posts
    76
    Becuase the on click event was not in double quotes the return false did not fire.

    Placing the entire thing in double quotes solved the problem.

  12. #12
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594
    For your information, you may only omit the quotes if your value is either all digits or all letters. Any punctuation or a mix of digits and letters and you HAVE to use quotes. In general, it's good style to always use quotes.
    IE is just the best browser at interpreting incorrect HTML.
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

  13. #13

    Thread Starter
    Lively Member
    Join Date
    Nov 2001
    Posts
    76
    It is kind of hard to enclose in double quotes when you are building the <input> tag with document.write

  14. #14
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594
    It's unreadable, but by no means hard. Just use the backslash correctly
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

  15. #15

    Thread Starter
    Lively Member
    Join Date
    Nov 2001
    Posts
    76
    I did, it was a mess. Fianlly just moved to ASP for it.

Posting Permissions

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



Click Here to Expand Forum to Full Width