Sha256: 81e037a07b4e1c776cc7e5907f8ba4059c627f95437f3ccab82a9ba665d00ebd

Contents?: true

Size: 721 Bytes

Versions: 7

Compression:

Stored size: 721 Bytes

Contents

var httpRequest;
<% @_vanity_experiments.each do |name, alternative| %>
  var params = "e=<%= name %>&a=<%= alternative.id %>&authenticity_token=<%= CGI.escape(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

7 entries across 7 versions & 1 rubygems

Version Path
vanity-1.9.3 lib/vanity/templates/_vanity.js.erb
vanity-1.9.2 lib/vanity/templates/_vanity.js.erb
vanity-2.0.0.beta4 lib/vanity/templates/_vanity.js.erb
vanity-2.0.0.beta3 lib/vanity/templates/_vanity.js.erb
vanity-2.0.0.beta2 lib/vanity/templates/_vanity.js.erb
vanity-2.0.0.beta lib/vanity/templates/_vanity.js.erb
vanity-1.9.1 lib/vanity/templates/_vanity.js.erb