javascript - Open new window isn't working -


what i'm trying open new window in every item in table display. when tried click isn't working , there's syntaxerror: syntax error in console. why that?

 echo"  <tr class='record'>             <td>".$i++."</td>             <td><a href='#' onclick='window.open('edit.php?pn=".$row['id']."', 'newwindow', 'width=500, height=200'); return false;'><img src='images/edit.png'></a></td>             <td align='center'><a href='#' name='".$row['id']."' class='delbutton'><img src='images/del.png' border='0' width='10' height='10' title='delete'></a></td>"; 

the quotation marks getting mixed in onclick attribute. rewrite code like:

 echo"  <tr class='record'>             <td>".$i++."</td>             <td><a href='#' onclick=\"window.open('edit.php?pn=".$row['id']."', 'newwindow', 'width=500, height=200'); return false;\"><img src='images/edit.png'></a></td>             <td align='center'><a href='#' name='".$row['id']."' class='delbutton'><img src='images/del.png' border='0' width='10' height='10' title='delete'></a></td>"; 

Comments

Popular posts from this blog

css - I want to align grid in center -

Contact Form PHP Email Script -

python - SWIG function not printing output -