-1

pls find below the script below ...

I want to insert a link on the url variable !

<script type="text/javascript">
jQuery.noConflict();                    
jQuery(document).ready(function ($) {
    $(".to-lock-1").sociallocker({
        text: {
            header: "<center>The content is locked!</center>",
            message: "<center></br>Please support us, click like button below to download the Wallpaper.</center>"
        },

        theme: "starter",

        locker: {
            close: false,
            timer: 0
        },

        buttons: {                                
            order: ["facebook-like", "twitter-tweet", "twitter-follow", "google-plus", "linkedin-share"]
        },

        facebook: {  
            appId: "206841902768508",
            like: {
                title: "Like us",
                url: "https://www.facebook.com/9H9Gang"
            }
        },

        twitter: {
            tweet: {
                title: "Tweet",
                text: "PHPGang Programming Blog, Tutorials, jQuery, Ajax, PHP, MySQL and Demos.",
                URL: "http://www.phpgang.com/"
            },
            follow: {
                title: "Follow us",
                url: "http://twitter.com/phpgang"
            }
        },

        google: {                                
            plus: {
                title: "Plus +1",
                url: "http://www.phpgang.com/"
            }
        },

        linkedin: {
            url: "http://www.phpgang.com/",                                
            share: {
                title: "Share"
            }
        }
    });
});

I want to change the URL: "http://www.phpgang.com/ to URL: "<?php the_permalink(); ?>

I'm using this script to lock a part of a content on my wordpress blog!`

        twitter: {
        tweet: {
            title: "Tweet",
            text: "PHPGang Programming Blog, Tutorials, jQuery, Ajax, PHP, MySQL and Demos.",
            URL: "http://www.phpgang.com/"
        },
        follow: {
            title: "Follow us",
            url: "http://twitter.com/phpgang"
        }
    }
pradip
  • 197
  • 4
  • 11
  • 1
    possible duplicate of [Pass a PHP string to a JavaScript variable (and escape newlines)](http://stackoverflow.com/questions/168214/pass-a-php-string-to-a-javascript-variable-and-escape-newlines) – Bucket May 01 '14 at 17:29

1 Answers1

0
<?php $htmlString= 'testing'; ?>
<html>
  <body>
    <script type="text/javascript">  
      // notice the quotes around the ?php tag         
      var htmlString="<?php echo $htmlString; ?>"; //put your code here
      alert(htmlString);
    </script>
  </body>
</html>

try this.this is an easy example ...Thank you

Ferrakkem Bhuiyan
  • 2,741
  • 2
  • 22
  • 38
  • My knowledge on php and javacript is very limited , can you help me insert the code on the above script – pradip May 02 '14 at 02:50