Image.src not working after loading popup window

Discussion in 'Javascript' started by shawn@actionjackson.com, May 23, 2006.

  1. Guest

    I have a simple script located here which loads different images when
    you click on some links. Everything works fine until you click on the
    last link which opens a popup window (zoom image). After you close
    this window and try to click on the different links they make the image
    dissappear. Does anyone know what I can do to get it to work even
    after I view the popup window? It seems like it loses focus or the
    document model changes or something.

    Thanks!

    Working Example:
    http://www.designerbridalonline.com/test.htm


    Source Code:
    -----------------------------------------------------------
    <html>
    <head>
    <SCRIPT LANGUAGE="JavaScript">
    <!-- hide from non JavaScript Browsers
    Image1= new Image
    Image1.src =
    "http://www.designerbridalonline.com/store/images/items/fullsize/FJ80Toy.jpg"

    Image2= new Image
    Image2.src =
    "http://www.designerbridalonline.com/store/images/items/view2/FJ80Toy.jpg"

    Image3= new Image
    Image3.src =
    "http://www.designerbridalonline.com/store/images/items/view3/FJ80Toy.jpg"

    Image4= new Image
    Image4.src =
    "http://www.designerbridalonline.com/store/images/items/view4/FJ80Toy.jpg"
    // End Hiding -->
    </SCRIPT>
    </head>
    <body>
    <img name=ItemImage border="0"
    src="http://www.designerbridalonline.com/store/images/items/fullsize/FJ80Toy.jpg"
    hspace="4" vspace="4" border=0>
    <br />
    <a href="javascript:;" onclick="document.ItemImage.src=Image1.src">Rear
    Passengers Side</a><br>
    <a href="javascript:;" onclick="document.ItemImage.src=Image2.src">Rear
    Drivers Side</a><br>
    <a href="javascript:;" onclick="document.ItemImage.src=Image3.src">Side
    View</a><br>
    <a href="javascript:;"
    onclick="document.ItemImage.src=Image4.src">Front Drivers Side</a><br>
    <a href="javascript:;"
    onClick="window.open('http://www.designerbridalonline.com/store/images/items/zoom/FJ80Toy.jpg','','width=660,height=505');
    return false;">Open Zoom Window</a></font>
    </body>
    </html>
    , May 23, 2006
    #1
    1. Advertising

  2. wrote:
    > I have a simple script located here which loads different
    > images when you click on some links. Everything works fine
    > until you click on the last link which opens a popup window
    > (zoom image). After you close this window and try to click
    > on the different links they make the image dissappear.

    <snip>

    You are using javascript: pseudo-protocol HREFs in your links. This is
    one of the many undesirable symptoms that follow from the execution of
    javascript pseudo-protocol HREFs.

    Richard.
    Richard Cornford, May 23, 2006
    #2
    1. Advertising

  3. Guest

    I noticed this example does work fine in Firefox but not IE. If I get
    rid of the HREF's what would you recommend to replace them? Thanks!
    , May 23, 2006
    #3
  4. wrote:
    > I noticed this example does work fine in Firefox but
    > not IE.


    The pseudo-protocol issue is most evident in IE browsers, but commercial
    scripting always must work with IE so javascript pseudo-protocol HREFs
    are out of the question anyway.

    > If I get rid of the HREF's what would you recommend to
    > replace them? Thanks!


    I would not design a script without knowing the context I was designing
    it for.

    You should read the group's FAQ with regard to conventional posting
    style:-

    <URL: http://jibbering.com/faq/ >

    - else you will not be getting much useful help here (assuming you are
    willing to understand and act accordingly).

    Richard.
    Richard Cornford, May 24, 2006
    #4
  5. Guest

    Thanks Richard. Changing out the HREF's with any other type of object
    worked pefectly in IE.
    , May 24, 2006
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Steve Richter

    <txt src= ...> equivalent of <img src= ...>

    Steve Richter, Feb 8, 2006, in forum: ASP .Net
    Replies:
    3
    Views:
    2,048
    Laurent Bugnion
    Feb 9, 2006
  2. Greg Johnson
    Replies:
    4
    Views:
    3,042
  3. Replies:
    1
    Views:
    1,595
    Alex Hunsley
    Mar 23, 2007
  4. pheadxdll
    Replies:
    16
    Views:
    3,585
    Neredbojias
    Jun 6, 2007
  5. Raffi
    Replies:
    4
    Views:
    198
    Dr John Stockton
    Aug 12, 2004
Loading...

Share This Page