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

Popular posts from this blog

c# - Unity IoC Lifetime per HttpRequest for UserStore -

Change the color of an oval at click in Java AWT -

I am trying to solve the error message 'incompatible ranks 0 and 1 in assignment' in a fortran 95 program. -