php - Getting error after adding onclick event -


following php code using return image, getting errors. kindly let me know did wrong. error not happen if remove onclick event following code.

return ('<img onclick="window.open('http://google.com','_blank')" src="'.$content.'" alt=""/>'); 

you didn't escape single quotes:

return ('<img onclick="window.open(\'http://google.com\', \'_blank\')" src="'.$content.'" alt=""/>'); 

Comments

Popular posts from this blog

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

html - How to style widget with post count different than without post count -

url rewriting - How to redirect a http POST with urlrewritefilter -