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
<?php
$mode = "lista";
$pages = "2";
$shortcodeactpasadas = '[actividades_shortcode pagina="'.$pages.'" modo="'.$mode.'" fecha="pasadas"]';
echo do_shortcode($shortcodeactpasadas); ?>
- in the script:
var modoShortcode = "<?php echo $mode ?>";
-
error in console:
-
firefox debugger