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 ?
- 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
- Uncaught TypeError: Object [object Object] has no method 'first_div'
the controller :
- $.Controller("first_div",
- /* @static */
- {
- defaults : {
- defaultText : "Hi, i am firstDiv!"
- }
- },
- /* @prototype */
- {
- pressCounter : 0,
- /**
- * Initialize a new instance of the firstDiv controller.
- */
- init : function() {
- this.refresh();
- },
- /**
- * Responds to a click on th button created by the template
- * @param el Not used
- */
- '#my_first_button click': function( el ){
- this.pressCounter++;
- this.refresh();
- },
-
- refresh : function() {
- $('#first_div ').html('../view/first_div_init.ejs', {header:this.options.defaultText}, {counter:this.pressCounter});
- }
- }
- );
the file- steal('jquery',
- 'jquerypp/class',
- 'jquerypp/model',
- 'jquerypp/dom/fixture',
- 'jquerypp/view/ejs',
- 'jquerypp/controller',
- 'jquerypp/controller/route',
- 'mvcForNewbies1/controller/first_div.js',
- function($){
- $(document).ready(
- function() {
- // Create a new first_div controller on the #first_div element
- $("#first_div").first_div();
- }
- )
- }
- )
I am struggling again to understand what is wrong it works for others and not for me and it looks the same..