This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var myElement = document.getElementById('IDoftheDIV'); | |
if(window.addEventListener) { | |
// Normal browsers | |
myElement.addEventListener('DOMSubtreeModified', contentChanged, false); | |
} else | |
if(window.attachEvent) { | |
// IE | |
myElement.attachEvent('DOMSubtreeModified', contentChanged); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<!-- 0. UTF-8 encoding --> | |
<meta charset="utf-8"> | |
<!-- 1. (OPTIONAL) Move jQuery here. --> | |
<!-- 2. (OPTIONAL) Datalayer --> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function() { | |
var d = false; | |
window.optimizely = window.optimizely || []; | |
var o = window.optimizely; | |
if (o.activeExperiments && o.allExperiments) { | |
for (var i = 0; i < o.activeExperiments.length; i++) { | |
var experimentId = o.data.state.activeExperiments[i]; | |
var experimentName = experimentId; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(function() { | |
var experimentID = optimizely.data.state.activeExperiments[0]; | |
var experimentName = experimentID; | |
if (typeof optimizely.data.experiments[experimentID] !== 'undefined') { | |
experimentName = optimizely.data.experiments[experimentID].name; | |
} | |
var variationName = optimizely.data.state.variationNamesMap[experimentID]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(function() { | |
var experimentID = optimizely.data.state.activeExperiments[0]; | |
var experimentName = experimentID; | |
if (typeof optimizely.data.experiments[experimentID] !== 'undefined') { | |
experimentName = optimizely.data.experiments[experimentID].name; | |
} | |
var variationName = optimizely.data.state.variationNamesMap[experimentID]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (typeof jQuery != 'undefined') { | |
jQuery(document).ready(function($) { | |
var filetypes = /\.(zip|exe|pdf|doc*|xls*|ppt*|mp3)$/i; | |
var baseHref = ''; | |
if (jQuery('base').attr('href') != undefined) | |
baseHref = jQuery('base').attr('href'); | |
jQuery('a').each(function() { | |
var href = jQuery(this).attr('href'); | |
if (href && (href.match(/^https?\:/i)) && (!href.match(document.domain))) { | |
jQuery(this).click(function() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (typeof jQuery != 'undefined') { | |
jQuery(document).ready(function($) { | |
var filetypes = /\.(zip|exe|dmg|pdf|doc.*|xls.*|ppt.*|mp3|txt|rar|wma|mov|avi|wmv|flv|wav)$/i; | |
var baseHref = ''; | |
if (jQuery('base').attr('href') != undefined) baseHref = jQuery('base').attr('href'); | |
jQuery('a').on('click', function(event) { | |
var el = jQuery(this); | |
var track = true; | |
var href = (typeof(el.attr('href')) != 'undefined' ) ? el.attr('href') :""; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Remove loading screen from Google Optimize | |
// @version 0.1 | |
// @description Script to remove the annoying loading screen... | |
// @author @simondahla | |
// @match https://optimize.google.com/optimize/home/ | |
// ==/UserScript== | |
(function() { | |
var element = document.getElementsByClassName('opt-busy-dialog') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Define your search query parameter as varible sn | |
var sn = "q"; | |
var sr = new RegExp(sn+"=[^\&]+"); | |
p = document.location.pathname; | |
s = document.location.search; | |
if (!!s.match(sr)) { | |
sm = s.match(sr).toString(); | |
srs = sm.split("="); | |
// The next line is where we add the category and add |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var pixelRatio = (window.devicePixelRatio >= 1.5) ? "high" : "normal"; | |
ga('send', 'pageview', {'dimension5': pixelRatio}); |
NewerOlder