Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <script src="jquery-1.2.3.min.js"></script>
- <script type="text/javascript"> var jQ = $.noConflict(true); </script>
- <script type="text/javascript">
- jQ(document).ready(function() {
- jQ().ajaxStart(function() {
- jQ('#loading').show();
- jQ('#result').hide();
- }).ajaxStop(function() {
- jQ('#loading').hide();
- jQ('#result').fadeIn('slow');
- });
- jQ('#frm').submit(function() {
- var formData = new FormData($(this)[0]);
- jQ.ajax({
- type: 'POST',
- url: jQ(this).attr('action'),
- data: jQ(this).serialize(),
- success: function(data) {
- jQ('#result').html(data);
- }
- })
- return false;
- });
- })
- </script>
- $("form#data").submit(function(){
- var formData = new FormData($(this)[0]);
- $.ajax({
- url: window.location.pathname,
- type: 'POST',
- data: formData,
- async: false,
- success: function (data) {
- alert(data)
- },
- cache: false,
- contentType: false,
- processData: false
- });
- return false;
- });
Add Comment
Please, Sign In to add comment