Page History

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

HTML
<script type="text/javascript">
	$('head').append('<meta property=\"og:url\" content=\"https://demogigyademo.gigya.com/recipe3.php\">');
	$('head').append('<meta property=\"og:title\" content=\"postBookmark Demo\">');
	$('head').append('<meta property=\"og:type\" content=\"article\">');
	$('head').append('<meta property=\"og:description\" content=\"postBookmark API call demo.\">');
	$('head').append('<meta property=\"og:image\" content=\"https://demogigyademo.gigya.com/images/recipe3.png\" />');
</script>

...

HTML
<div id="runningCodeExample" style="border: 1px solid skyblue; padding: 15px; width: auto; display: block; height: auto;"> 
 <style>
        .demo_main {
            width: 90%;
            height: auto;
            margin-left: auto;
            margin-right: auto;
            padding: 10px;
            text-align: center;
        }
        
    </style>
        <div class="demo_main">
            <header style="font-size:1.2em; color: #149dd6;">Take a look at the code below for the complete source of this example.  To implement this example on your site, be sure to change the apiKey to your company's active apiKey.</header><br />
            <!-- Script for defining variables for the postBookmark instances -->
            <script>
				// Define an image media item:
				var image = {
					type: 'image',
					src: 'https://demogigyademo.gigya.com/images/recipe3.png',
					href: 'https://demogigyademo.gigya.com/recipe3.php'
					};
				// Define a UserAction object
				var ua = new gigya.socialize.UserAction();
				ua.setLinkBack("https://demogigyademo.gigya.com/recipe3.php");
				ua.setTitle("postBookmark Demo");
				ua.setDescription("postBookmark API call demo.");
				ua.addMediaItem(image);
				// Define a UserAction object specific for Twitter
				var uatw = new gigya.socialize.UserAction();
				uatw.setLinkBack("https://demogigyademo.gigya.com/recipe3.php");
				uatw.setTitle("postBookmark API call demo");
				// Variable definition for Facebook share
				var FBParams ={
					provider: 'facebook',
					url: 'https://demogigyademo.gigya.com/recipe3.php',
					userAction: ua,
					cid: 'Facebook share from Gigya postBookmark demo.'
				};
				// Variable definition for Twitter share, note the Twitter specifica UA object
				var TWParams ={
					provider: 'twitter',
					url: 'https://demogigyademo.gigya.com/recipe3.php',
					userAction: uatw,
					cid: 'Twitter Shares from Gigya postBookmark demo.'
				};
            </script>
            <div>
                <a href="" onclick="gigya.socialize.postBookmark(FBParams)"><img alt='Facebook' src='https://demogigyademo.gigya.com/images/follow_bar/Facebook_on_follow.png' height="50px" width="50px" /></a>
                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                <a href="" onclick="gigya.socialize.postBookmark(TWParams)"><img alt='Twitter' src='https://demogigyademo.gigya.com/images/follow_bar/Twitter_on_follow.png' height="50px" width="50px" /></a>
            </div>
            <p>
                <a target="_blank" href="//developers.gigya.com/display/GD/socialize.postBookmark (JS)">postBookmark Documentation</a>
            </p>
        </div>
</div>

...

Code Block
languagejs
<html>
	<head>
        <title></title>
        <!-- Open Graph Tags -->
		<meta property="og:url" content="https://demogigyademo.gigya.com/recipe3.php">
		<meta property="og:title" content="postBookmark Demo">
		<meta property="og:type" content="article">
        <meta property="og:description" content="postBookmark API call demo.">
		<meta property="og:image" content="https://demogigyademo.gigya.com/images/recipe3.png" />
		
        <!-- Load Gigya's Web SDK -->
		<script type="text/javascript" lang="javascript" src="https://cdns.gigya.com/js/gigya.js?apikey=3_mK2cmEzLkzhqe4MUrtPncxbv4wKsYAhsew0iVwhVUls3c_Jx_HLX434jAVpq5M_W">	
		</script>	
	</head>

	<body>
<div id="runningCodeExample" style="border: 1px solid skyblue; padding: 15px; width: auto; display: block; height: auto;"> 
 <style>
        .demo_main {
            width: 90%;
            height: auto;
            margin-left: auto;
            margin-right: auto;
            padding: 10px;
            text-align: center;
        }
    </style>
        <div class="demo_main">
            <h4>Take a look at the code below for the complete source of this example.  To implement this example on your site, be sure to change the apiKey to your company's active apiKey.</h4>
            <!-- Script for defining variables for the postBookmark instances -->
            <script>
				// Define an image media item:
				var image = {
					type: 'image',
					src: 'https://demogigyademo.gigya.com/images/recipe3.png',
					href: 'https://demogigyademo.gigya.com/recipe3.php'
					};
				// Define a UserAction object
				var ua = new gigya.socialize.UserAction();
				ua.setLinkBack("https://demogigyademo.gigya.com/recipe3.php");
				ua.setTitle("postBookmark Demo");
				ua.setDescription("postBookmark API call demo.");
				ua.addMediaItem(image);
				// Define a UserAction object specific for Twitter
				var uatw = new gigya.socialize.UserAction();
				uatw.setLinkBack("https://demogigyademo.gigya.com/recipe3.php");
				uatw.setTitle("postBookmark API call demo");
				// Variable definition for Facebook share
				var FBParams ={
					provider: 'facebook',
					url: 'https://demogigyademo.gigya.com/recipe3.php',
					userAction: ua,
					cid: 'Facebook share from Gigya postBookmark demo.'
				};
				// Variable definition for Twitter share, note the Twitter specifica UA object
				var TWParams ={
					provider: 'twitter',
					url: 'https://demogigyademo.gigya.com/recipe3.php',
					userAction: uatw,
					cid: 'Twitter Shares from Gigya postBookmark demo.'
				};
            </script>
            <div>
                <a href="" onclick="gigya.socialize.postBookmark(FBParams)"><img alt='Facebook' src='https://demogigyademo.gigya.com/images/follow_bar/Facebook_on_follow.png' height="50px" width="50px" /></a>
                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                <a href="" onclick="gigya.socialize.postBookmark(TWParams)"><img alt='Twitter' src='https://demogigyademo.gigya.com/images/follow_bar/Twitter_on_follow.png' height="50px" width="50px" /></a>
            </div>
            <p>
                <a target="_blank" href="//developers.gigya.com/display/GD/socialize.postBookmark (JS)">postBookmark Documentation</a>
            </p>
        </div>
</div>
	</body>
</html>

...