Value returned by function has javascript appended to the end

douggough@drupal.org - March 22, 2007 - 19:29

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

Devel Module too

thekeyper - March 29, 2007 - 04:26

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

Devel...

Shedrow713@grou... - April 9, 2007 - 05:19

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

 
 

Drupal is a registered trademark of Dries Buytaert.