Skip to content

Instantly share code, notes, and snippets.

@mwilliams
Forked from bkmorse/gist:111660
Created May 14, 2009 13:29

Revisions

  1. mwilliams revised this gist May 14, 2009. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions gistfile2.html
    Original file line number Diff line number Diff line change
    @@ -10,6 +10,7 @@
    $(':input', this).each(function() {
    inputs.push(this.name + '=' + escape(this.value));
    })
    // Adding a comment here to show a commit change.
    jQuery.ajax({
    data: inputs.join('&'),
    url: this.action,
  2. mwilliams revised this gist May 14, 2009. 1 changed file with 0 additions and 36 deletions.
    36 changes: 0 additions & 36 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -1,36 +0,0 @@
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
    "http://www.w3.org/TR/html4/strict.dtd">
    <HTML>
    <HEAD>
    <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.js" type="text/javascript" charset="utf-8"></script>
    <script type="text/javascript" charset="utf-8">
    $(document).ready(function() {
    $('#form_div').submit(function() {
    var inputs = [];
    $(':input', this).each(function() {
    inputs.push(this.name + '=' + escape(this.value));
    })
    jQuery.ajax({
    data: inputs.join('&'),
    url: this.action,
    timeout: 2000,
    error: function() {
    console.log("Failed to submit");
    },
    success: function(r) {
    console.log("Posted successfully.");
    }})
    return false;
    })
    });
    </script>
    </HEAD>
    <BODY>
    <div id="form_div">
    <form id="my_form" action="ajax_sample.html" method="POST" accept-charset="utf-8">
    <textarea name="text" rows="8" cols="40"></textarea>
    <p><input type="submit" id="submit_button" value="Continue &rarr;"></p>
    </form>
    <div>
    </BODY>
    </HTML>
  3. mwilliams revised this gist May 14, 2009. 1 changed file with 36 additions and 0 deletions.
    36 changes: 36 additions & 0 deletions gistfile2.html
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,36 @@
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
    "http://www.w3.org/TR/html4/strict.dtd">
    <HTML>
    <HEAD>
    <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.js" type="text/javascript" charset="utf-8"></script>
    <script type="text/javascript" charset="utf-8">
    $(document).ready(function() {
    $('#form_div').submit(function() {
    var inputs = [];
    $(':input', this).each(function() {
    inputs.push(this.name + '=' + escape(this.value));
    })
    jQuery.ajax({
    data: inputs.join('&'),
    url: this.action,
    timeout: 2000,
    error: function() {
    console.log("Failed to submit");
    },
    success: function(r) {
    console.log("Posted successfully.");
    }})
    return false;
    })
    });
    </script>
    </HEAD>
    <BODY>
    <div id="form_div">
    <form id="my_form" action="ajax_sample.html" method="POST" accept-charset="utf-8">
    <textarea name="text" rows="8" cols="40"></textarea>
    <p><input type="submit" id="submit_button" value="Continue &rarr;"></p>
    </form>
    <div>
    </BODY>
    </HTML>
  4. @invalid-email-address Anonymous created this gist May 14, 2009.
    36 changes: 36 additions & 0 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,36 @@
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
    "http://www.w3.org/TR/html4/strict.dtd">
    <HTML>
    <HEAD>
    <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.js" type="text/javascript" charset="utf-8"></script>
    <script type="text/javascript" charset="utf-8">
    $(document).ready(function() {
    $('#form_div').submit(function() {
    var inputs = [];
    $(':input', this).each(function() {
    inputs.push(this.name + '=' + escape(this.value));
    })
    jQuery.ajax({
    data: inputs.join('&'),
    url: this.action,
    timeout: 2000,
    error: function() {
    console.log("Failed to submit");
    },
    success: function(r) {
    console.log("Posted successfully.");
    }})
    return false;
    })
    });
    </script>
    </HEAD>
    <BODY>
    <div id="form_div">
    <form id="my_form" action="ajax_sample.html" method="POST" accept-charset="utf-8">
    <textarea name="text" rows="8" cols="40"></textarea>
    <p><input type="submit" id="submit_button" value="Continue &rarr;"></p>
    </form>
    <div>
    </BODY>
    </HTML>