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
Post a Comment