Skip to content

Instantly share code, notes, and snippets.

@octatone
Created May 26, 2011 20:17
Show Gist options
  • Save octatone/993980 to your computer and use it in GitHub Desktop.
Save octatone/993980 to your computer and use it in GitHub Desktop.
usage for blog buttons
button_options = document.createElement( 'script' );
button_options.type = 'text/javascript';
button_options.text = "reddit_url = '" + data.songs.song[0].reddit_url + "';\n";
button_options.text += "reddit_title = '" + data.songs.song[0].reddit_title + "';\n";
button_options.text += "reddit_target = 'radioreddit';\n";
button_options.text += "reddit_newwindow = 1;\n";
button_script = document.createElement( 'script' );
button_script.type = 'text/javascript';
button_script.src = 'http://reddit.com/static/button/button1.js';
document.getElementById("test_area").appendChild(button_options);
document.getElementById("test_area").appendChild(button_script);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment