1

When I click on the link, it works and open a new window and shows the image but the main page also changes to a new page with this url address :

javascript:window.open('documents/receive_proof_1_2015-08-07_94583855.jpg', 'yourWindowName', 'width=400,height=330');

my code :

<a href="javascript:window.open(\'documents/'.$row['proof'].'\', \'yourWindowName\', \'width=400,height=330\');">Test</a>'
putvande
  • 15,068
  • 3
  • 34
  • 50
khodayar J
  • 914
  • 8
  • 16

1 Answers1

0

You are clicking on an a tag with a not-empty href attribute: of course the browser will redirect you to the href value. I suggest you to not use the href attribute for javascript; either use the onclick attribute or (better) use jQuery to attach the event to the tag.