Problem Passing php variable to Javascript

Basically I have some php variables with content that I need to “import” and use in Javascript variables, but when I do so I get a weird error that theres a br tag or Nan values.
In the template.php

      $mode = "lista";
      $pages = "2";   
      $shortcodeactpasadas = '[actividades_shortcode pagina="'.$pages.'" modo="'.$mode.'" fecha="pasadas"]';
      echo do_shortcode($shortcodeactpasadas); ?>
  1. in the script:

var modoShortcode = "<?php echo $mode ?>";

  1. error in console:

  2. firefox debugger

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.