1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

How would I echo post title in Javascript?

Discussion in 'Making Money' started by thizzladen, Jul 1, 2011.

  1. thizzladen

    thizzladen Power Member

    Joined:
    Jul 11, 2009
    Messages:
    591
    Likes Received:
    450
    Occupation:
    Doing whatever bakes the cake.
    Location:
    In house. With television and remote control.
    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.
     
  2. diquaniemdau

    diquaniemdau Newbie

    Joined:
    Jul 15, 2013
    Messages:
    8
    Likes Received:
    0
    Location:
    http://xiangqimaster.com/
    Home Page:
    Nobody answers it until now
    :(
     
  3. omaigadlol

    omaigadlol Registered Member

    Joined:
    Oct 25, 2008
    Messages:
    65
    Likes Received:
    18
    Is [the title] an HTML <title> element? if so:

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