What I'm doing is that in wordpress I'm creating an object with
post.push([
{
contenido: "<?php the_content(); ?>",
}
])
But when I do that, the content returns it to me in HTML and javascript marks it as an error.
What I'm doing is that in wordpress I'm creating an object with
post.push([
{
contenido: "<?php the_content(); ?>",
}
])
But when I do that, the content returns it to me in HTML and javascript marks it as an error.
It seems that push
should support a json. Therefore you should escape it.
You could try:
post.push([
{
contenido: "<?php json_encode(the_content()); ?>",
}
])