Try with this:
$ad_div1='<div onclick="window.location=\'http://wwww/google.com\'">xxx</div>';
If you need dynamic url use,
$ad_div1='<div onclick="window.location=\''.$url.'\'">xxx</div>';
Domanda
I want to write an onclick function
inside quotes but it throws error
$ad_div1='<div onclick="window.location="\"/"http://wwww/google.com"\"/"">xxx</div>';
How to add these quotes correctly ?
Soluzione
Try with this:
$ad_div1='<div onclick="window.location=\'http://wwww/google.com\'">xxx</div>';
If you need dynamic url use,
$ad_div1='<div onclick="window.location=\''.$url.'\'">xxx</div>';