javascript new window cancel original href and target -


Lt; A target = "_ blank" onclick = "new window (this)" href = "http://www.google.co.uk" & gt; Google & lt; / A & gt;

This is my external javascript which opens a new window, then cancels the target with the original href and firing.

  function newWindow (element) {var newWin = window. Open (element.href, windowName, "top = 0, left = 0, height = 800, width = 700, resizable = yes, scrollbars = yes, toolbar = no, menubar = no, location = no"); Return [element.href = 'javascript: zero ()', element.target = '_self']; }  

This works fine for 1 click, my problem is that href appears if the user clicks the link again

  & Lt; A href = "javascript: zero ();" & Gt;  

Then the link wont work!

What am I doing wrong?

How do I code it after opening the popup window, the original href and targets have been canceled? Can the link be clicked more than once?

Thanks

Here's a fully functional task:

< Pre> & lt; One goal = "_ blank" onclick = "new window (this); return back;" Href = "http://www.google.co.uk" & gt; Google & lt; / A & gt; Javascript:
  function navigator (element) {var newWin = window.open (element.href, 'window-name', 'top = 0 , Left = 0, height = 800, width = 700, resizable = yes, scrollbar = yes, toolbar = no, menubar = no, location = no ");}  

Comments