Skip to content

Commit

Permalink
Printing Java Variables
Browse files Browse the repository at this point in the history
It really sucks, but I need the shortcode to output a variable to
Javascript.
  • Loading branch information
mmcnew committed Jan 21, 2016
1 parent 669b2c4 commit 2127a09
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion vc-gmaps-bg.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ function bg_gmap( $atts ) {
$a = shortcode_atts ( array (
'position' => '33.958827, -117.639830',
), $atts );
return "<script> var position = [$a];</script>
return "<script type='text/javascript'> var position = [$a['position']]; </script>
<div id='googlemaps'></div>";
}
add_shortcode( 'bgmap', 'bg_gmap' );
Expand Down

0 comments on commit 2127a09

Please sign in to comment.