Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Window.Open is opening 2 windows. Help Please

Status
Not open for further replies.

MikeDamone

Programmer
Joined
Oct 21, 2003
Messages
106
Location
US
I have a link that has
href='javascript:window.open('http:yahoo.com test=yes&id=1234')

When the link is clicked, it opens the javascript window which then opens another window. The javascript window is blank except for the word [Object] DOes anyone know how to make it only open one window? Thanks
 
<a href=&quot;javascript: window.open('http:yahoo.com test=yes&id=1234')&quot;>some text</a>


Programming today is a race between software engineers striving to build better and bigger idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. - Rick Cook (No, I'm not Rick)

 
hmm - I do it this way

<a href=&quot;&quot; onClick=&quot;window.open('http:yahoo.com test=yes&id=1234')&quot;>some text</a>


Programming today is a race between software engineers striving to build better and bigger idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. - Rick Cook (No, I'm not Rick)

 
Try this:

Code:
<a href=&quot;javascript:var handle=window.open('[URL unfurl="true"]http://www.yahoo.com/');&quot;>link</a>[/URL]

The reason you were getting [Object] is because the window.open command was returning a handle to the window, and you weren't putting it into a variable.

Hope this helps,

Dan
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top