I having hard time fixing this error in my app.js. The error is in line 284 where app.js:262 Uncaught ReferenceError: $ is not defined
at HTMLDivElement. (app.js:262).
I just want to display (using alert) the information I collected from the getinfobyaccountno.php but my plan is to display them in html of course.
You can see that I have hardcoded the accountNumber variable. Actually it is one of my another concern because I have them as a global variable.
Please see my code below.
var self = this;
var app = self.$app;
var $ = self.$;
Or follow framework7 git repo
Are you using JQuery in addition to Framework7?
Framework7 uses ‘$$’ as the selector for Dom7, because JQuery uses ‘$’.
Either add JQuery to your project, or change references of ‘$’ to ‘$$’.
carefull with newcomers
framework7 doesn’t really use “$$” as selector for dom-manipulation
actually it is just “Dom7”
you can do:
var $$ = Dom7; $$('selector');
var $$$ = Dom7; $$$('selector');
var dummy = Dom7; dummy('selector');
I’m just going by best practices from the docs:
we recommend to assign it to some local variable with more handy name, like
$$ , but not to “$” to prevent confilicts with other libraries like jQuery or Zepto
Thanks everyone. @kerrydp answer by adding jquery fix my concern.
Another of my concern is how to prepare, declare and access global variable, will prepare another question for that.
To solve this error: