displaying a code with JS callback on Google+ button :)

Discussion in 'Game Development (Technical)' started by Jack Norton, Jul 12, 2011.

  1. Jack Norton

    Indie Author

    Joined:
    Jul 28, 2004
    Messages:
    5,126
    Likes Received:
    0
    I'm setting up another experiment to see how it works:
    http://www.winterwolves.com/gamesdiscount.htm
    in practice I offer discount to people if they spread the word. The FB app was already made by a friend of mine, but I was wondering: I know you can set up a JS callback function with the Google+ button.
    Now I wanted this callback function to display a coupon code to get the discount, but the problem is that I don't want people to be able to see it just looking at the page source code... :D
    So was wondering if there is a system to display a simple text message (code) after user clicks the Google+, but that can be hidden/protected? or it's a limit of JS ?

    Thanks
     
  2. Indiepath

    Indiepath New Member

    Joined:
    Aug 22, 2004
    Messages:
    999
    Likes Received:
    0
    I would suggest an ajax function that the callback calls. the ajax call returns a valid code.


    or send the discount code to the browser in a cookie and use JS to display the contents of that cookie.
     

Share This Page

  • About Indie Gamer

    When the original Dexterity Forums closed in 2004, Indie Gamer was born and a diverse community has grown out of a passion for creating great games. Here you will find over 10 years of in-depth discussion on game design, the business of game development, and marketing/sales. Indie Gamer also provides a friendly place to meet up with other Developers, Artists, Composers and Writers.
  • Buy us a beer!

    Indie Gamer is delicately held together by a single poor bastard who thankfully gets help from various community volunteers. If you frequent this site or have found value in something you've learned here, help keep the site running by donating a few dollars (for beer of course)!

    Sure, I'll Buy You a Beer