I have a flash widget that interfaces with a module through a menu callback, like so:

function flashvote_menu($may_cache) {
  global $user;
  $items = array();
 
   if ($may_cache) {
    $items[] = array(
      'path' => 'flashvote/vote',
      'callback' => 'flashvote_vote',
      'type' => MENU_CALLBACK,
      'access' => user_access('use up-down vote'),
    );
   
   }
  return $items;
}

function flashvote_vote() {
 $votevalue = 89; //this is an arbitrary value for testing
 print "&voteVal=$votevalue";
}  

When I click on the button in the flash widget, it successfully calls flashvote/vote, and get's the value of $votevalue returned to it. But what is returned is the value of $votevalue (in this case, the number 89) and then a javascript which appears to be the "document ready" code from jquery. For example:

89<script type="text/javascript">
      $(document).ready(function() {
        $("body").append("");
      });
    </script> 

So, where is the javascript coming from?

Any help is appreciated,

Doug Gough

Comments

Chris Gillis’s picture

I am getting the same bit of script at the end of my page (after </html> therefore invalid) when I install the devel module.

Shedrow713@groups.drupal.org’s picture

Turning off the Devel module worked perfectly for me. Thanks for the tip!!