When you use Foundation's Abide form validation with the data-abide="ajax" attribute, every time you click submit, n+1 events are fired.
A Pen by Brian Hanna on CodePen.
| const gulp = require('gulp'); | |
| const glob = require('glob'); | |
| const sourcemaps = require('gulp-sourcemaps'); | |
| const source = require('vinyl-source-stream'); | |
| const buffer = require('vinyl-buffer'); | |
| const browserify = require('browserify'); | |
| const watchify = require('watchify'); | |
| const babel = require('babelify'); | |
| function compile(watch) { |
| # just including the /resuluts/<job_key> route | |
| @app.route('/results/<job_key>', methods=['GET']) | |
| def get_results(job_key): | |
| job = Job.fetch(job_key, connection=conn) | |
| if job.is_finished: | |
| result = Result.query.filter_by(id=job.result).first() | |
| results = sorted( | |
| result.result_no_stop_words.items(), |
| module.exports = function(grunt) { | |
| grunt.initConfig({ | |
| }); | |
| // grunt.loadNpmTasks('grunt-contrib-concat'); | |
| grunt.registerTask('default', ['']); | |
| }; |
| /** | |
| * @function ajax | |
| * @desc IE 5.5+, Firefox, Opera, Chrome, Safari XHR object | |
| * @param {string} url - The URL of the resource being requested | |
| * @param {function} callback - Function to execute on successful response | |
| * @param {mixed} data - Data to be sent with POST request | |
| */ | |
| function ajax(url, callback, data) { | |
| try { | |
| var xhr = this.XMLHttpRequest || ActiveXObject, |
| // This is valid for MEAN.js 0.4.0 | |
| // Requires a couple of changes to work: | |
| // Add Drive scope to users Express route | |
| // Modify the Passport.js google strategy to put a token expiration date into the database | |
| // User middleware function below to auth API calls | |
| exports.requiresOAuth2Token = function (req, res, next) { | |
| var OAuth2 = google.auth.OAuth2; | |
| var client = new OAuth2(config.google.clientID, config.google.clientSecret, config.google.callbackURL); | |
| client.setCredentials({ |
When you use Foundation's Abide form validation with the data-abide="ajax" attribute, every time you click submit, n+1 events are fired.
A Pen by Brian Hanna on CodePen.