How would I echo post title in Javascript?

thizzladen

Power Member
Joined
Jul 11, 2009
Messages
765
Reaction score
671
I'm temporaraly using a content locker from Leadbolt until I have enough money to get CL Pro.

What I'm trying to do is, at the top of the locker, Have it say something like:

To View [post title] Please Complete An Offer:

I tried <?php the_title(); ?>, but it won't work in JS :(.

I'm using Wordpress, BTW.
 
Is [the title] an HTML <title> element? if so:

<script type="text/javascript">
alert(document.title);
</script>
 
Back
Top