Skip to content

Instantly share code, notes, and snippets.

@aymannadeem
Created May 20, 2013 21:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aymannadeem/5615638 to your computer and use it in GitHub Desktop.
Save aymannadeem/5615638 to your computer and use it in GitHub Desktop.
The first commented line is your dabblet’s title
/**
* The first commented line is your dabblet’s title
*/
background: #f06;
background: linear-gradient(45deg, #f06, yellow);
min-height: 100%;
<!DOCTYPE html>
<html>
<body>
<p>
Javascript fun times. Here's learning how to write Javascript directly into html output stream.
</p>
<script type="text/javascript" src="https://www.dropbox.com/static/api/1/dropins.js" id="dropboxjs" data-app-key="isrbjpa0i5l8zpl"></script>
<input type="dropbox-chooser" name="selected-file" id="db-chooser"/>
<script type="text/javascript">
document.getElementById("db-chooser").addEventListener("DbxChooserSuccess",
function(e) {
alert("Here's the chosen file: " + e.files[0].link)
}, false);
</script>
Dropbox.choose(options);
<script>
document.write("<h1>Doing stuff with headings.</h1>");
document.write("<p>..and now with paragraphs.</p>");
</script>
<p>
Use <strong>document.write</strong> in HTML output
If it's used after the document has loaded (ex. in a function), the whole doc will be overwritten.
</p>
<p>
yo dawg, Javascript is mad useful for reacting to events, like the click of a button:
</p>
<button type="button" onclick="alert("YIKES")">Click here</button>
</body>
</html>
// alert('Hello world!');
{"view":"split","fontsize":"100","seethrough":"","prefixfree":"1","page":"all"}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment