javascript-framework

JavaScript frameworks and CSS frameworks: JQuery, YUI, neither, or something else? [closed]

依然范特西╮ 提交于 2019-12-02 21:27:25
I haven't done web development for about 6 years. I'm trying to get back into it and there is a lot of new stuff out there. I've chosen to write my next project with Perl and Catalyst. I keep hearing about various JavaScript and CSS frameworks. I know very little about these frameworks so maybe this question is overly broad and open ended. What are the strengths, weaknesses, and popularity of the various frameworks? Should I be using YUI, JQuery, neither, or something else? cletus Firstly, it's probably worth perusing Which Javascript framework (jQuery vs Dojo vs … )? . Secondly, there are two

Which JavaScript-framework can search CSS stylesheet rules and edit their properties?

女生的网名这么多〃 提交于 2019-12-02 20:48:28
The Question Which JavaScript framework (prototype, script.aculo.us, Mootools, MochiKit...) has decent CSS rule editing support? This is about changing a style rule. I want to have dynamic CSS classes which change. Example: <style> #answer, .reveal { display: none; color: blue; } #answer { /* additional stuff */ } </style> Now, via JavaScript, I want to change the rule that has the “display: none” in it. – I’m convinced that sometimes this is the right way to go; I’m not looking for alternatives, when it is not the right way to do. Which framework out there makes the following easy: select a

Django and Mustache use the same syntax for template

点点圈 提交于 2019-12-02 20:25:00
I try to smuggle HTML template in the HTML for mustache.js, however the django template engine remove all the placeholders that should be output as-is to the front-end The template is included in HTML in this way: <script type="text/x-mustache-template" data-id="header_user_info"> <div id="header_user_info"> <div id="notification">0</div> <a href="#">{{username}}</a> </div> </script> and I can get the HTML template by running $(el).html(), and generate html by using Mustache.to_html(temp, data); I could put all the template into another static file and serve from CDN, but then it would be hard

AngularJS example in backbone.js and/or knockout.js

只谈情不闲聊 提交于 2019-12-02 19:42:19
I'm comparing these frameworks to do some calculations on the client side. I really liked the example on the AngularJS site. I was wondering if any of the backbone.js or knockout.js experts on the site would please recreate that example in their respective frameworks. Here is the JSFiddle for it. Code of the Fiddle: <table ng:init="invoice= {items:[{qty:10, description:'gadget', cost:9.95}]}"> <tr> <th>Qty</th> <th>Description</th> <th>Cost</th> <th>Total</th> <th></th> </tr> <tr ng:repeat="item in invoice.items"> <td><input name="item.qty" value="1" size="4" ng:required ng:validate="integer">

Which JavaScript Library Has the Most Comprehensive Class Inheritance Support? [closed]

谁说胖子不能爱 提交于 2019-12-02 19:08:04
After playing with a dozen different JavaScript Libraries such as Prototype, jQuery, YUI, just to name a few, I found every different library has a different way of simulating some sort of Class Hierarchy and provide some sort of Class Inheritance support. (Other than jQuery) Other than being very annoyed that when you create a new class, it has to be library dependent, unless you do the plain old way. I'm wondering which library offers the best support for class inheritance in general and why. I hope maybe one day JavaScript Library authors can agree on one style for Class creation and

What are your tips for best practice for web application structure? [closed]

萝らか妹 提交于 2019-12-02 16:23:56
I do a lot of custom applications at work. I'm trying to define some standards for new applications. Something a little like Elements. CSS : How do you organize the style sheets? Should I have one base style sheet for the whole site and one for each individual page for customizations? Should I have another for print styles? I've heard that linking more files takes more time for the browser to retrieve them. (More objects per page...also a problem with lots of javascript files or images) ... How many is is too many? Do you heavily comment your CSS? Provide any nested structure? Alphabetize

Coffeescript — How to create a self-initiating anonymous function?

坚强是说给别人听的谎言 提交于 2019-12-02 14:05:55
How to write this in coffeescript? f = (function(){ // something })(); Thanks for any tips :) While you can just use parentheses (e.g. (-> foo)() , you can avoid them by using the do keyword: do f = -> console.log 'this runs right away' The most common use of do is capturing variables in a loop. For instance, for x in [1..3] do (x) -> setTimeout (-> console.log x), 1 Without the do , you'd just be printing the value of x after the loop 3 times. If you want to "alias" the arguments passed to self-invoking function in CoffeeScript, and let's say this is what you are trying to achieve: (function

Angular JS Verify CSRF Token in POST Request

孤街浪徒 提交于 2019-12-02 14:04:53
I am using AngularJS with Rails. I have the following request which updates users in bulk. $http{ method: 'POST', url: $scope.update_url, params: {selected_ids: userIds} } This cannot be a 'GET' request due to restrictions in the length of the URL (http://support.microsoft.com/kb/208427) But for 'POST' request, we need to have a CSRF authenticity token in the header. How can we set the CSRF Token to the post request header? You can set http headers as explained in the $http service. You can set it up globally: $httpProvider.defaults.headers.post['My-Header']='value' (or) $http.defaults.headers

Backbone.js and jQuery

和自甴很熟 提交于 2019-12-02 13:51:00
It is said that Backbone handles all the higher level abstractions, while jQuery or similar libraries work with the DOM, normalize events and so on.. Could someone please help me understand this statement with any simple practical example. Also one important feature of MVC framework like Backbone, Knockout is that it keeps the model (data) and the view in sync. But this seems to be specific at a page-level and not across the entire application. So can we have the model/data and the view synced across multiple pages..(kind of global) Backbone / Knockout is typically used for single page

What are the real-world strengths and weaknesses of the many frameworks based on backbone.js? [closed]

◇◆丶佛笑我妖孽 提交于 2019-12-02 13:46:17
Hope that someone can share their experience with some of the latest emerging backbone.js variants out there. I have some good experience with backbone/underscore/require in several projects and I will like to take the next step towards more advanced solutions for complex application structure. I know the following frameworks are available: Marionette Geppetto (based on Marionette) Chaplin , Chaplin - chaplin-boilerplate Vertebrae LayoutManager Thorax Aura Luca Singool backstack Backbone UI hulk BTW - excellent starting point for big scale project And probably I missed a few. There is a short