javascript - I want to addEventListener on php variable -
i want addeventlistener on variable $html_tab when clicked go www.google.com
$html_tab .= '<td align="center" valign="middle">'. $row['numeunitate'] . '</td>'; echo "<script language='javascript'> window.addeventlistener('click', function() { var location.href = 'http://www.google.com'; }); </script>";
ok, after i've seen error, understand question.
var location.href = 'http://www.google.com';
don't use keywort var in here. work. otherwise browser thinks, want declare new variable!
so, write only
location.href = 'http://www.google.com';
Comments
Post a Comment