Skip to content

Instantly share code, notes, and snippets.

var jq = document.createElement('script');
jq.src = "https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js";
document.getElementsByTagName('head')[0].appendChild(jq);
jq.onload = function() {
var rows = $('.table-responsive tbody tr');
var dateToValueMap = {};
var existingKeys = {};
var doneValue = 0;
@benxie
benxie / ajaxListener.js
Created August 17, 2016 19:05
JS: Listent on XMLHttpRequest
var bxAjaxListener = {};
bxAjaxListener.tempOpen = XMLHttpRequest.prototype.open;
bxAjaxListener.tempSend = XMLHttpRequest.prototype.send;
bxAjaxListener.callback = function () {
// DO YOUR STUFF with this.method, this.data, this.url
};
XMLHttpRequest.prototype.open = function(a,b) {
if (!a) a='';
if (!b) b='';
@benxie
benxie / ajaxListener.js
Created August 17, 2016 19:01 — forked from icodejs/ajaxListener.js
JS: Listen to ajax calls from Javascript
var open = window.XMLHttpRequest.prototype.open,
send = window.XMLHttpRequest.prototype.send,
onReadyStateChange;
function openReplacement(method, url, async, user, password) {
var syncMode = async !== false ? 'async' : 'sync';
console.warn(
'Preparing ' +
syncMode +
' HTTP request : ' +
@benxie
benxie / spotlight_img
Created June 12, 2015 17:19
Spotlight Sample with Image
/* excute it here: https://www.eyebuydirect.com/eyeglasses/men-page-3 */
var spotlight = function(config){
var conf = {
bgColor: "rgba(0,0,0,0.75)",
lightStart: 0,
lightEnd: 0.7,
size: 100,
blurRadius: 20,
interval: 10,
steps: 30,
@benxie
benxie / CSS Animation.html
Last active August 29, 2015 14:21
CSS3 Animation - Move div x and y
<div id="slide"></div>
<div id="bounce"></div>