Back

Template Source: bdconversion/plugins/jquery.facebook.invite.html

<script> (function($){ $.fn.facebook_invite = function(opts) { FB.ui({ method: 'apprequests', message: opts.action_text || "Select your friends and invite them", // redirect_uri: window.location.protocol + "//" + window.location.host + "/membership/invitation/create/" }, function(responce){ var formStr = "<form action='{% url bdconversion-invitation-create %}' method='post'>"; {% if invitation_landing %} formStr += '<input type="hidden" name="invitation_landing" value="{{ invitation_landing.pk }}">'; {% endif %} formStr += "{% csrf_token %}"; formStr += "<input type='text' name='request_id' value='"+responce.request+"'>"; for(var i=0; i<responce.to.length; i++){ formStr += "<input type='text' name='to' value='"+responce.to[i]+"'>"; } formStr += "</form>"; $(formStr).appendTo("body").submit(); }); }; })(jQuery); </script>