Why pop-up window not working-javascript/html?

Discussion in 'JavaScript' started by tptnyc, Jun 10, 2011.

  1. #1
    <html>
    <head>
    <SCRIPT language="JavaScript">
    <!--

    function PopUp(pPage) {
    window.open(pPage,'popWin','resizable=yes,scrollbars=yes,width=580,height=460,toolbar=no');
    }

    //-->
    </SCRIPT>
    </head>
    <body>
    <A href="javascriptopUp('images/kheri_abstract_21_large.JPG');"><img src="images/style_five.JPG" alt="" border=0></a>
    </body>
    </html>
     
    tptnyc, Jun 10, 2011 IP
  2. rainborick

    rainborick Well-Known Member

    Messages:
    424
    Likes Received:
    33
    Best Answers:
    0
    Trophy Points:
    120
    #2
    Try:
    
    <A href="" onclick="PopUp('images/kheri_abstract_21_large.JPG'); return false;">
    
    Code (markup):
    You had a syntax error in your original HTML.
     
    rainborick, Jun 10, 2011 IP
  3. tptnyc

    tptnyc Peon

    Messages:
    764
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    0
    #3
    tptnyc, Jun 11, 2011 IP
  4. SSC

    SSC Active Member

    Messages:
    995
    Likes Received:
    10
    Best Answers:
    0
    Trophy Points:
    80
    #4
    Do you think your script should be under comment tags?

    *forgive me if i sound like a newbie because i am not a JS pro
     
    SSC, Jun 11, 2011 IP
  5. rainborick

    rainborick Well-Known Member

    Messages:
    424
    Likes Received:
    33
    Best Answers:
    0
    Trophy Points:
    120
    #5
    When you say it's not working, what do you mean? What happens? Have you checked that the variable 'pPage' is a valid URL? Are there any other JavaScript errors on the page?
     
    rainborick, Jun 11, 2011 IP
  6. tptnyc

    tptnyc Peon

    Messages:
    764
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    0
    #6
    pop-up window opens up but with no image in it. I guess the problem is with this one:

    <A href="javascriptopUp('images/kheri_abstract_21_large.JPG');"><img src="images/style_five.JPG" alt="" border=0></a>

    style_five.JPG (thumbnail image)
    kheri_abstract_21_large.JPG ( the larger one)
     
    tptnyc, Jun 11, 2011 IP
  7. tptnyc

    tptnyc Peon

    Messages:
    764
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    0
    #7
    Finally, with the following code, pop-up window showing image but now how to add thumbnail image in place of CLICK HERE.

    <a href="javascript:eek:penWin('images/kheri_abstract_21_large.JPG','pop3',720,540);">CLICK HERE</a>

    style_five.JPG (thumbnail image)
    kheri_abstract_21_large.JPG ( the larger one)
     
    tptnyc, Jun 11, 2011 IP