How do we use Javascript function in PHP -


i using wordpress social media plug-in. when user clicks on icon opens link in new tab, want in new window, purpose using javascript function

<script type="text/javascript"> // popup window code function newpopup(url) {     popupwindow = window.open(         url,'popupwindow','height=700,width=800,left=10,top=10,resizable=yes,scrollbars=yes,toolbar=yes,menubar=no,location=no,directories=no,status=yes') } </script> 

but main problem code written in php , don't have idea how use javascript function in it. here php function.

$out_button = array(             'tag' => 'a',             'class' => 'synved-social-button synved-social-button-' . $context .  ' synved-social-provider-' . $button_key . $class_extra,             'data-provider' => $button_key,             'target' => $button_key != 'mail' ? '_blank' : '',             'rel' => 'nofollow',             'title' => $title,             'href' => $href,             'child-list' => array(                 array(                     'tag' => 'img',                     'alt' => $button_key,                     'class' => 'synved-share-image',                     'width' => $size,                     'style' => 'width:' . $size . 'px;' . $style,                     'src' => $image_uri,                 )             )         ); 

'href' => $href, in have write javascript function idea how can it.

it looks though php array should setting target _blank if key isn't mail. if set

 'target' => '_blank', 

does give desired result?


Comments

Popular posts from this blog

jquery - How can I dynamically add a browser tab? -

node.js - Getting the socket id,user id pair of a logged in user(s) -

keyboard - C++ GetAsyncKeyState alternative -