0

I tried to hook my link to a <tr> and made some like this:

<tr onlick=document.location.href='something.html'>

I do find it working but the thing is.. I want to make the link in a popup window and have this function..

function popit(url){
    newwindow = window.open(url, '', "status=yes, height=500; width=500; resizeable=no");
}

It's quite working fine when I applied it to some of my <a> but the thing is I cant use popit(url) function and at the same time use onclick attribute to a <tr>.

3
  • try this: <tr onclick="javascript:window.open('something.html', '', "status=yes, height=500; width=500; resizeable=no");"> Commented Apr 29, 2013 at 16:26
  • A little additional reading, stackoverflow.com/questions/5871640/… Commented Apr 29, 2013 at 16:33
  • onlick? Just what kind of event are you expecting the browser to respond to!? Commented Apr 29, 2013 at 16:40

1 Answer 1

2

You should just be able to specify:

<tr onclick="popit('something.html')">

As long as the popit() function is a properly defined global function elsewhere in your javascript.

You can see it work here: http://jsfiddle.net/jfriend00/5rWep/

Sign up to request clarification or add additional context in comments.

1 Comment

You beat me to it :). This is the same thing I wrote

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.