Sha256: 28685eea561459082ac7bf7efd452de06c7a9926af37e7b4f6de87ec951ccc16

Contents?: true

Size: 734 Bytes

Versions: 8

Compression:

Stored size: 734 Bytes

Contents

var httpRequest;
<% @_vanity_experiments.each do |name, alternative| %>
  var params = "e=<%= name %>&a=<%= alternative.id %>&authenticity_token=" + encodeURIComponent("<%= form_authenticity_token %>");
  if (window.XMLHttpRequest) { // Mozilla, Safari, ...
    httpRequest = new XMLHttpRequest();
  } else if (window.ActiveXObject) { // IE
    try { httpRequest = new ActiveXObject("Msxml2.XMLHTTP"); }
    catch (e) { }
  }
  if (httpRequest) {
    httpRequest.open('POST', "<%= Vanity.playground.add_participant_path %>", true);
    httpRequest.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
    httpRequest.setRequestHeader("X-Requested-With", "XMLHttpRequest");
    httpRequest.send(params);
  }
<% end %>

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
vanity-1.8.4 lib/vanity/templates/_vanity.js.erb
vanity-1.9.0 lib/vanity/templates/_vanity.js.erb
vanity-1.9.0.beta lib/vanity/templates/_vanity.js.erb
vanity-1.8.3 lib/vanity/templates/_vanity.js.erb
vanity-1.8.3.beta2 lib/vanity/templates/_vanity.js.erb
vanity-1.8.3.beta lib/vanity/templates/_vanity.js.erb
vanity-1.8.2 lib/vanity/templates/_vanity.js.erb
vanity-1.8.1 lib/vanity/templates/_vanity.js.erb