Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function doRequest(url) {
- xmlhttp = new XMLHttpRequest();
- xmlhttp.open("POST", url, true);
- xmlhttp.onreadystatechange = function() {
- if (xmlhttp.readyState == 4) {
- alert(xmlhttp.responseText)
- }
- }
- xmlhttp.send(null);
- }
- $(document).ready(function(){
- $('#new').click(function(){
- var snippet = $('textarea').val();
- var gists = 'http://gist.github.com/gists';
- var url = gists+'?file_ext[gistfile1]=php&file_name[gistfile1]=aFile&file_contents[gistfile1]='+snippet+'&user=theimben&token=ce2f109e83777d2bdbbcccd2d28349b5';
- doRequest(url);
- });
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement