Don’t the data attribute options used in Bootstrap, Angular.js, and Ember.js conflict with Unobtrusive Javascript principles? [closed]

Unobtrusive Javascript is a good practice for many places on the web. The frameworks you mentioned are often used for creating full-blown Javascript applications. In many of these apps, the experience without Javascript is often a blank page. In that environment, the value of separating your markup from Javascript is relatively low.

Backbone model.destroy() invoking error callback function even when it works fine?

@David Tuite comment: “Ok I figured it out. It seems that Backbone expects the JSON response to be a JSON serialization of the record that was destroyed. However, Rails controller generators only return head :ok by default. I changed my JSON response to be render json: @listing_save where @listing_save is the record I just destroyed … Read more

Good jQuery Mobile walkthrough or tutorial for a jquery developer? [closed]

[edit] Some of the information below is outdated as JQM 1.0 final was released Here are a few I have come across that I have found useful: For those who are using Rails and the Devise authentication gem: http://everydayrails.com/2010/11/09/jquery-mobile-rails-devise.html Pretty thorough tutorial http://www.elated.com/articles/jquery-mobile-what-can-it-do-for-you Has example zip http://devgrow.com/mobile-web-dev-using-jquery-mobile Short tutorial on ajax http://www.giantflyingsaucer.com/blog/?p=1948

Output jasmine test results to the console

Have you tried the ConsoleReporter? jasmine.getEnv().addReporter(new jasmine.ConsoleReporter(console.log)); According to the code Jasmine has the ConsoleReporter class that executes a print function (in this case console.log) that should do what you need. If all else fails you could just use this as a starting point to implement your own console.log reporter. UPDATE In newer versions of … Read more

How to set up JavaScript namespace and classes properly?

Do neither of those things. Make a javascript “class”: var MyClass = function () { var privateVar; //private var privateFn = function(){}; //private this.someProperty = 5; //public this.anotherProperty = false; //public this.someFunction = function () { //public //do something }; }; MyNamespace.MyClass = new MyClass(); One with static vars: var MyClass = (function(){ var static_var; … Read more

How to generate UL Li list from string array using jquery?

var countries = [‘United States’, ‘Canada’, ‘Argentina’, ‘Armenia’]; var cList = $(‘ul.mylist’) $.each(countries, function(i) { var li = $(‘<li/>’) .addClass(‘ui-menu-item’) .attr(‘role’, ‘menuitem’) .appendTo(cList); var aaa = $(‘<a/>’) .addClass(‘ui-all’) .text(countries[i]) .appendTo(li); });

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)