Debugging Simple Javascript (It says Stripe is not defined)

javascript

#1

(document).ready(function() { Stripe.setPublishableKey((‘meta[name=“stripe-key”]’).attr(‘content’));
// Watch for a form submission:
("#form-submit-btn").click(function(event) { event.preventDefault(); (‘input[type=submit]’).prop(‘disabled’, true);
var error = false;
var ccNum = ('#card_number').val(), cvcNum = (’#card_code’).val(),
expMonth = ('#card_month').val(), expYear = (’#card_year’).val();
if (!error) {
// Get the Stripe token:
Stripe.createToken({
number: ccNum,
cvc: cvcNum,
exp_month: expMonth,
exp_year: expYear
}, stripeResponseHandler);
}
return false;
}); // form submission
function stripeResponseHandler(status, response) {
// Get a reference to the form:
var f = $("#new_user");
// Get the token from the response:
var token = response.id;
// Add the token to the form:
f.append(’’);
// Submit the form:
f.get(0).submit();
}
});


#2

If it says that Stripe is not defined, have you checked how you load Stripe in the first place?


#3

Hate to be that guy, but this is not a place to get Javascript help. There are many forums and communities that would gladly help out with Javascript issues. This is a Cloud9 forums, and this is a board for Cloud9 bugs.