Quantcast
Channel: JavaScriptMVC Forum
Viewing all articles
Browse latest Browse all 3491

Re : How to make working JqueryMX ?

$
0
0
Ok thank you, yes I will check out but I need a working Jquery environment and it is not working yes with what you  replied. now I have :
Do you know where is the problem now ?

  1. 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 'Controller' first_div.js:1
    1. (anonymous function)first_div.js:1
  1. Uncaught TypeError: Object [object Object] has no method 'first_div'

the controller :
  1. $.Controller("first_div",
  2.     /* @static */
  3.     {
  4.         defaults : {
  5.             defaultText : "Hi, i am firstDiv!"
  6.         }
  7.     },
  8.     /* @prototype */
  9.     {
  10. pressCounter : 0,
  11.         /**
  12.          * Initialize a new instance of the firstDiv controller.
  13.          */
  14.         init : function() {
  15.             this.refresh();
  16.         },
  17.         /**
  18.          * Responds to a click on th button created by the template
  19.          * @param el    Not used
  20.          */
  21.         '#my_first_button click': function( el ){
  22.             this.pressCounter++;
  23. this.refresh();
  24.         },
  25. refresh : function() {
  26. $('#first_div ').html('../view/first_div_init.ejs',  {header:this.options.defaultText}, {counter:this.pressCounter});
  27. }

  28.     }
  29. );
the file
  1. steal('jquery',
  2.  'jquerypp/class',
  3.       'jquerypp/model',
  4.       'jquerypp/dom/fixture',
  5.       'jquerypp/view/ejs',
  6.       'jquerypp/controller',
  7.       'jquerypp/controller/route',
  8.       'mvcForNewbies1/controller/first_div.js',
  9.         function($){
  10.              $(document).ready(
  11.                 function() {
  12.                     // Create a new first_div controller on the #first_div element
  13.                     $("#first_div").first_div();
  14.                }
  15.             )

  16.         }
  17.     )
I am struggling again to understand what is wrong it works for others and not for me and it looks the same..

Viewing all articles
Browse latest Browse all 3491

Trending Articles