javascript-framework

Suggestions for a JavaScript form builder? [closed]

≡放荡痞女 提交于 2019-11-29 19:38:46
I'm looking to integrate a form builder into a site I'm using, but I'm hoping to find a library that has some or most of the functionality I'm looking for. I'm looking for a library that will give me a nice GUI for building the form, and a JSON (or XML, or similar) output that I can play with in the django backend. I'm planning to use django to output the finished form. I tried running this through Google, but that only yields companies who make a business out of creating and hosting the forms online. But nothing in the form of a library. Any suggestions? If you dont mind spending a bit of

Easiest way to interate over a complex JSON object via Javascript

六月ゝ 毕业季﹏ 提交于 2019-11-29 17:01:16
I'm consuming JSON data that has a bit of a weird structure for example: { "RESULT": { "COLUMNS": ["ID","name","ENABLED","perms","vcenabled","vcvalue","checkenabled","checkvalue","indxenabled","indxvalue"], "DATA": [ [7,"Site-A", 1, "1,2", 1, 1, 1, 0, 0, 0], [15,"Site-B", 1, "1,2,3,4", 1, 1, 1, 0, 0, 0] ] }, "ERROR": 0 } I would like to create some JavaScript that would restructure this data to proper JSON structures so that the "Column" array values become the keys for the "DATA" array's values. So after a JS process is run the data resembles the following: [ {"ID":7,"name":"Site-A","ENABLED"

Dual jsTree Implementation

落爺英雄遲暮 提交于 2019-11-29 15:47:24
问题 I am newbie to jsTree, I want to use dual jsTree. [left JsTrree] [ >> ] [right JsTrree] ">>" : Button for copy selected node from left to right jsTree I want to copy partial tree hierarchy from left to right jsTree. No duplication of node. I don't want to copy child node of selected node Only selected node from left jsTree merge into right jsTree as per right jsTree structure If user selected any node from left jsTree then on button(">>") click I want to copy partial tree from selected node

Passed in undefined argument in jQuery core source code

廉价感情. 提交于 2019-11-29 13:22:23
I noticed that in the jQuery core, one of the two arguments passed in is undefined. (function( window, undefined ) { // Use the correct document accordingly with window argument (sandbox) var document = window.document; var jQuery = (function() { // ...defintion of the rest of the core... window.jQuery = window.$ = jQuery; })(window); Can anyone explain why the second argument is undefined ? Thanks in advance! Undefined is a type but is also a global variable. You can have a module that overwrites the value of undefined by doing undefined = whatever . jQuery uses a immediate function to scope

Angular JS observe on directive attribute

谁都会走 提交于 2019-11-29 06:03:06
问题 How can angular js watch attributes on custom directive in order to accept angular values to be bind Here is what I have so far: <tile title="Sleep Duration" data-value="{{sleepHistory.averageSleepTime}}"/> app.directive('tile', [function() { return { restrict: 'E', link: function(scope, element, attrs) { var title = attrs.title; attrs.$observe('dataValue', function(val) { var data = val; console.log(data); var dom = "<div>" + "<p>" + title + "</p>" + "<p>" + data + "</p>" + "</div"; $

What is the danger in including the same JavaScript library twice?

馋奶兔 提交于 2019-11-29 02:48:20
One of the webapps I'm working in is made up of many partial HTML files. If the partial requires a JavaScript library such as YUI, the YUI library is included in the partial. When the partials are combined at runtime, the resulting HTML often includes the YUI library several times. <html> ... <script type="text/javascript" src="/js/yahoo/yahoo-min.js"></script> ... <script type="text/javascript" src="/js/yahoo/yahoo-min.js"></script> ... <script type="text/javascript" src="/js/yahoo/yahoo-min.js"></script> ... </html> I've seen strange behavior from including jQuery several times, especially

javascript clientside routing/pathing library [closed]

两盒软妹~` 提交于 2019-11-29 02:11:53
I'm in the need for a routing library to handle my paths for a client side js app. I'm currently using backbone.js, which while great, is not fully featured enough. I'm looking for a dedicated pathing library that I can replace backbone with (only in terms of pathing, still want to use that for MVC), something with a lot of features. Thanks There are a number of interesting routing libraries at http://www.microjs.com/#spa Backbone, and Crossroads (and its accompanying library, Hasher) are both listed there, but you should also check out Director (independent module from the Flatiron framework)

Javascript: How to put a simple delay in between execution of javascript code?

醉酒当歌 提交于 2019-11-29 02:08:26
I have a for loop which iterates more than 10,000 times in a javascript code. The for loop creates and adds < div > tags into a box in the current page DOM. for(i = 0; i < data.length; i++) { tmpContainer += '<div> '+data[i]+' </div>'; if(i % 50 == 0) { /* some delay function */ } } containerObj.innerHTML = tmpContainer; i want to put a delay after every 50 < div > tags so what will be the code at the place of /* some delay function */ because its taking too much time to load all 10,000 < div > tags. i want to update the box in chunks of 50 < div > tags. thanks in advance. There's a handy

Display a list from nested json: Sencha Touch 2

匆匆过客 提交于 2019-11-29 00:16:53
I have a list that displays a list of restaurants with the logo of the restaurant etc. The view Ext.define('Test.view.Contacts', { extend: 'Ext.List', xtype: 'contacts', config: { title: 'Stores', cls: 'x-contacts', store: 'Contacts', itemTpl: [ '<div class="headshot" style="background-image:url(resources/images/logos/{logo});"></div>', '{name}', '<span>{add1}</span>' ].join('') } }); When you tap the restaurant i want it to show another list based on the item tapped. The second view Ext.define('Test.view.Menu', { extend: 'Ext.List', xtype: 'contact-menu', config: { title: 'Menu', cls: 'x

Is plain vanilla JavaScript better than using frameworks like jQuery or MooTools? [closed]

允我心安 提交于 2019-11-28 22:57:13
问题 I am wondering if it is a good idea to rely on frameworks like jQuery or MooTools or should we just use plain JavaScript? Apart from avoiding the re-invention of wheel, do they add any specific value? Since the frameworks are open to the public, can there be possibility of exploitation of any security holes that might appear (of course, unintentionally :) ) in the frameworks? Are there any other points that are to be considered when choosing a framework or otherwise? 回答1: Frameworks solve