Skip to content

Instantly share code, notes, and snippets.

<html>
<head>
<title>Vue.js Router</title>
<meta charset="utf-8">
<script src="https://unpkg.com/vue"></script>
<script src="https://unpkg.com/vue-router@2.7.0/dist/vue-router.js"></script>
</head>
<body>
<div id="app">
<nav>
@optikalefx
optikalefx / Super Simple Ajax File Upload (XHR2).js
Last active February 17, 2026 23:46
Ajax File upload with jQuery and XHR2Sean Clark http://square-bracket.com
// Ajax File upload with jQuery and XHR2
// Sean Clark http://square-bracket.com
// xhr2 file upload
$.fn.upload = function(remote, data, successFn, progressFn) {
// if we dont have post data, move it along
if (typeof data != "object") {
progressFn = successFn;
successFn = data;
}