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
// 1. DOUBLE BAD!! | |
$("#myLink").attr("name","srhyne"); | |
$("#myLink").attr("href","http://stephenrhyne.com"; | |
$("myLink").html("stephenrhyne.com"); | |
// 2. IN MY OPINION STILL VERY BAD.. | |
$("#mylink") | |
.attr("name","srhyne") |
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
$('a[data-affiliate]').click(function(e){ | |
var _this = $(this); | |
e.preventDefault(); | |
var aff = _this.data('affiliate'); | |
Conveyour.track('chose_affiliate', { | |
affiliate : aff | |
}); | |
window.open(_this.attr('href'), "_blank"); | |
}); |
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
This is an appendix to [conveyour-analytics-with-javascript](http://conveyour.com/help/conveyour-analytics-with-javascript). | |
See step 3. How do you get the user data into that Conveyour.identify call? | |
The steps | |
- In your PHP file gather the desired user meta data | |
- Echo the gathered data out as a JSON variable in your PHP file | |
- Use that new javascript object as a reference in the identify call. | |
Example |
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> | |
<meta http-equiv="Content-type" content="text/html; charset=utf-8"> | |
<title>Page Refresh</title> | |
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js"></script> | |
<script> | |
$(function(){ | |
var zoho, url, request; | |
zoho = { |
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
// Wrap in self-invoking anonymous function: | |
(function($){ | |
// Extend jQuery's native ':' | |
$.extend($.expr[':'],{ | |
// New method, "data" | |
data: function(a,i,m) { | |
var e = $(a).get(0), keyVal; |
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
// avoid using anon function cb's for high touch events | |
$("div").mousemove(function(){ | |
//this function is re-created every time w/ obvious overhead | |
}); | |
//avoid re-creating Class methods in a constructor pattern. Use prototype instead | |
//instead of this... | |
function Person(first, last){ |
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
/* jQuery Tiny Pub/Sub - v0.7 - 10/27/2011 | |
* http://benalman.com/ | |
* Copyright (c) 2011 "Cowboy" Ben Alman; Licensed MIT, GPL */ | |
(function($) { | |
var o = $({}); | |
$.subscribe = function() { | |
o.on.apply(o, arguments); |
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
// | |
// APPCELERATOR - STACKMOB IOS MODULE | |
// | |
// aaron@clearlyinnovative.com | |
// blog.clearlyinnovative.com | |
// | |
// http://stackmob.com | |
// | |
var window = Ti.UI.createWindow({ | |
backgroundColor: 'white' |
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
String.prototype.tmpl = function(obj){ | |
var str, keys, _do; | |
//store string | |
str = this.toString(); | |
//if no object just return string | |
if(!obj || typeof obj !== "object"){ | |
return str; | |
} |
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
// - jquery.event.fastfix.js | |
(function () { | |
// http://bitovi.com/blog/2012/04/faster-jquery-event-fix.html | |
// https://gist.github.com/2377196 | |
// IE 8 has Object.defineProperty but it only defines DOM Nodes. According to | |
// http://kangax.github.com/es5-compat-table/#define-property-ie-note | |
// All browser that have Object.defineProperties also support Object.defineProperty properly | |
if(Object.defineProperties) { | |
var |
OlderNewer