javascript-framework

Backbone.js and jQuery

喜夏-厌秋 提交于 2019-12-04 07:20:49
问题 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

JavaScript based iPhone UI framework

守給你的承諾、 提交于 2019-12-04 06:55:47
We have a push based web-application. Recently, we planned to make an iPhone app for it. Much like Facebook has it's iPhone application as well as web presence. We are looking for a UI framework that can get us going quickly. I've leafed through PhoneGap and couple other JS based UI frameworks mentioned here . I am bit unsure what can suit us the best. So, I am looking for your suggestions. Our constraints are as follows: The framework should be JS based. We all are web-devs and want to avoid learning Objective C. Framework should support iPhone's capabiilities as smoothly as a native app does

Any event to detect when the “Class” attribute is changed for a control

被刻印的时光 ゝ 提交于 2019-12-04 06:38:44
问题 I have a "div" control with some id="myDiv" class="myClass" var var1=10; in Javascript. Based on user action I will change the class for this control from "myClass" to "newClass" so when this has happened I want to change the value of var1 to 20. So how would I recognize that change in Class? 回答1: You may use onpropertychange(IE) and DOMAttrModified (others) 回答2: You'll have to use 3 things: onpropertychange event, for IE < 9 DOMAttrModified , works in IE9, Opera, Firefox, and not regrettably

“Can't bind to 'ngModel' since it isn't a known property of 'p-calendar'” error message trying to use PrimeNG component, why?

心已入冬 提交于 2019-12-04 02:48:42
I am very new in Angular 2\4 and I am trying to follow this quick video tutorial to add PrimeNG components to my Angular project: https://www.youtube.com/watch?v=6Nvze0dhzkE and the Get started section of the PrimeNG tutorial page: https://www.primefaces.org/primeng/#/setup So this is my app.component.html view: <!--The whole content below can be removed with the new code.--> <div style="text-align:center"> <h1> Welcome to {{title}}!! </h1> </div> <p-calendar [(ngModel)]="value"></p-calendar> {{value | date:'dd.mm.yyy'}} As you can see I have inserted this tag to show the calendar component:

Disable specific function key using jquery

自闭症网瘾萝莉.ら 提交于 2019-12-04 02:18:16
问题 I want to disable F8 key on my web page. Is there any way I can disable it using jquery or any associated plugins or just javascript?? Thanks in advance... :) blasteralfred 回答1: Like this Disable F5 key in Safari 4 but using keyCode 119: <script> var fn = function (e) { if (!e) var e = window.event; var keycode = e.keyCode; if (e.which) keycode = e.which; var src = e.srcElement; if (e.target) src = e.target; // 119 = F8 if (119 == keycode) { alert('nope') // Firefox and other non IE browsers

I am not able to understand how jQuery chaining works [closed]

妖精的绣舞 提交于 2019-12-03 22:45:59
I am not able to understand how jQuery chaining works. jQuery("div").attr("id", "_id") .hide() .show(); I did something like chaining, but I'm not sure if it's the same logic that jQuery uses. var fun = (function (parma) { return function () { return { start: function () { console.log("start"); return this; }, mid: function () { console.log("mid"); return this; }, last: function () { console.log("last"); return this; } } } })(); // Working fun().start() .mid() .last(); If the return value of a function is an object that has a method, you can call that method immediately. Simple as that. Since

How can I keep jointjs cells from overflowing the paper?

强颜欢笑 提交于 2019-12-03 20:44:38
问题 I'm using jointjs to make diagrams which will be user-editable. The user may drag them around and relocate each cell. However, when a cell is dragged to the edge, it overflows and becomes cut off. I want to prevent this from happening, instead the cell to stop before it gets to the edge of the paper and not be allowed to cross the edge, thus always staying completely within the paper. The behavior can be seen in jointjs' very own demos here: http://www.jointjs.com/tutorial/ports Try dragging

Performance test OpenLayers vs Leaflet

ⅰ亾dé卋堺 提交于 2019-12-03 17:39:21
问题 I would like to compare the performance between OpenLayers and Leaflet. I want to test things like which is the fastest to render vector files, basemaps, show a massive amount of markers etc. I can set up this examples myself, but I don't how to actually measure the difference in speed between them? Where can I see how long it actually takes to perform a task like loading the vector data into a map? I tried to use the 'Timeline' tab in Chrome under developper console but it's not that clear

Use Javascript frameworks without build tools like grunt and gulp? [closed]

随声附和 提交于 2019-12-03 15:05:06
Closed . This question needs to be more focused. It is not currently accepting answers. Learn more . Want to improve this question? Update the question so it focuses on one problem only by editing this post . Closed last year . I'm trying out some modern Javascript frameworks like Angular, React, Vue and Ember, and they all want me to use build tools like npm , grunt , gulp , maven , etc. Web-programming used to be fun. Just change some files, refresh the browser and see if it works. Now every time I change something, I have to build it again, which takes quite some time. I really hate to see

javascript framework for relationship visualization [duplicate]

血红的双手。 提交于 2019-12-03 14:05:11
This question already has answers here : Graph visualization library in JavaScript (5 answers) Possible Duplicate: Graph visualization code in javascript? I need to create a dynamic visualization for nodes and their relationships in Javascript. What's the best framework to use? This is what I've briefly reviewed so far: Flare - it's Flash and hasn't been updated in almost 2 years. JavaScript InfoVis Toolkit - interaction seems a little slow, maybe that's on purpose in the demos Protovis - documentation looks great, doesn't work in IE at all (can I get it to work with some kind of IE SVG