I am having to hook into a plugin and I need to actually output a value I get via jQuery. However, when I try to return it (I have to use return) it just escapes the javascript instead of actually giving me the value. So, the output on the screen is literally the text instead of the value ie: <script>document.write(buttontext);</script>
instead of some value
<script>
var myValue = jQuery( '.my_value' ).val();
<?php
$myValue ="<script>document.write(myValue);</script>";
?>
</script>
<?php
//.... some code.. $myValue ends up in $content which I return below
return $content;
?>