Skip to content

Instantly share code, notes, and snippets.

var addScriptTag = function(url) {
var node = document.createElement('script');
node.type = 'text/javascript';
node.async = true;
node.src = ('https:' === document.location.protocol ? 'https:' : 'http:') + url;
node.id = '' + new Date().getTime();
var topelem = (document.getElementsByTagName('head')[0] ||
document.getElementsByTagName('body')[0]);
topelem.appendChild(node);
};
@yieldmo
yieldmo / form.html
Created January 30, 2014 01:05 — forked from emaxerrno/*scratch*
<form method="post"
action="https://...some/form/action"
name="signup"
id="sadf22222"
accept-charset="UTF-8"
onsubmit="return verifyForm();" >
<input type="hidden"
class="ym_tag_with_click"
name="redirect"
value="http://example.com/trackme/yay/">
// this could be minified by their build system
//
(function(window,document){
var tokenizer = function(key, searchString) {
var result = new RegExp(key + "=([^&]*)", "i").exec(searchString || window.location.search);
return result && unescape(result[1]) || "";
};
var clickId = tokenizer('click_id');
if(!clickId || clickId.length < 1){
return;