Skip to content

Instantly share code, notes, and snippets.

View firewood3's full-sized avatar

firewood3

  • Jeju-do, Republic of Korea
View GitHub Profile
@carlosrivera
carlosrivera / ajax_download.js
Created April 10, 2015 15:49
Ajax file download using an iframe
//taken from http://stackoverflow.com/questions/4545311/download-a-file-by-jquery-ajax
function ajax_download(url, data) {
var $iframe,
iframe_doc,
iframe_html;
if (($iframe = $('#download_iframe')).length === 0) {
$iframe = $("<iframe id='download_iframe'" +
" style='display: none' src='about:blank'></iframe>"
@FelipeBudinich
FelipeBudinich / disable-context-menu.html
Last active February 18, 2022 10:24
Javascript, Disable context menu on right click
<!DOCTYPE html>
<html>
<head>
<title>Javascript, Disable context menu on right click</title>
<script type="text/javascript">
if (document.addEventListener) {
document.addEventListener('contextmenu', function (e) {
e.preventDefault();
}, false);
@ralphcrisostomo
ralphcrisostomo / array_dupplicate_counter.js
Created July 19, 2012 07:43
Javascript: Count duplicates in an array
/**
Problem:
You have a javascript array that likely has some duplicate values and you would like a count of those values.
Solution:
Try this schnippet out.
*/