RailsApps / rails-stripe-membership-saas

An example Rails 4.2 app with Stripe and the Payola gem for a membership or subscription site.
http://railsapps.github.io/rails-stripe-membership-saas
1.14k stars 232 forks source link

externalScript error #60

Closed fullmeasuredesign closed 11 years ago

fullmeasuredesign commented 11 years ago

I am at the stage of the tutorial where I am adding the javascript. When I run the website I get an error in the javascript console on this line:

$.externalScript('https://js.stripe.com/v1/').done(function(script, textStatus) {

It gives me the following error.

Uncaught TypeError: Object function ( selector, context ) { // The jQuery object is actually just the init constructor 'enhanced' return new jQuery.fn.init( selector, context, rootjQuery ); } has no method 'externalScript'

Any ideas what could be missing?

DanielKehoe commented 11 years ago

Did you add the file app/assets/javascripts/jquery.externalscript.js?

In the section "Create a Registrations JavaScript File", what message did you get with `console.log('Script loading: ' + textStatus );``?

fullmeasuredesign commented 11 years ago

Yes I included the jquery.externalscript.js file.

This is the log output when I run the app with the js from the "Create a Registrations JavaScript File"

Page-specific JavaScript on the registrations.new page. registrations.js:6 Uncaught TypeError: Object function ( selector, context ) { // The jQuery object is actually just the init constructor 'enhanced' return new jQuery.fn.init( selector, context, rootjQuery ); } has no method 'externalScript'

fullmeasuredesign commented 11 years ago

I found the error. There was a minor error in the code that was causing that externalscript.js file to not load. I fixed it.