Permalink
Browse files

changed url

  • Loading branch information...
melpomene committed Aug 10, 2012
0 parents commit ce7430f4e497c9ccee4d2678379279501e77da24
Showing with 25 additions and 0 deletions.
  1. +25 −0 reftail.js
@@ -0,0 +1,25 @@
+$(document).ready(function() {
+
+ function getUrlVars() {
+ var vars = {};
+ var parts = window.location.href.replace(/[?&]+([^=&]+)=([^&]*)/gi, function(m,key,value) {
+ vars[key] = value;
+ });
+ return vars;
+ }
+ ref = getUrlVars()["ref"];
+ host = window.location.hostname;
+ console.log(ref);
+ if (ref !== undefined) {
+ $.ajax({
+ url: "http://reftail.kejsarmakten.se/add",
+ data: {"ref": ref, "host": host }
+ });
+ }
+ $('.tictail_add_to_cart_button').bind('click', function() {
+ $.ajax({
+ url: "http://reftail.kejsarmakten.se/sell",
+ data: {"ref": ref, "host": host, "title":document.title}
+ });
+ });
+});

0 comments on commit ce7430f

Please sign in to comment.