javascript-framework

How to use javascript namespaces correctly in a View / PartialView

╄→гoц情女王★ 提交于 2019-12-20 02:04:39
问题 i've been playing with MVC for a while now, but since the project i'm on is starting to get wind in its sails more and more people are added to it. Since i'm in charge of hacking around to find out some "best practice", i'm especially wary about the possible misuses of javascript and would like to find out what would be the best way to have our views and partial views play nicely with javascript. For the moment, we're having code that looks like this (only simplified for example's sake)

Storing JSON data in browser memory

走远了吗. 提交于 2019-12-19 16:52:19
问题 I want to persist some JSON information in browser. Depending on user interaction with the application, I want to store 5-6 different JSON object into memory. What options I have to achieve this? Please suggest any library or plugin using which I can persist information in the browser. Thanks 回答1: To add to the solutions given, I'd also want to add a reference link Storing Objects in HTML5 localStorage where this question is discussed nicely. Below is the code var testObject = { 'one': 1,

Stock chart in ExtJS 4

荒凉一梦 提交于 2019-12-19 09:24:51
问题 How can I draw an stock chart or a line chart with hundreds points? I disabled animation in regular line chart, but not successful and still too heavy and slow. 回答1: I've recently written a blog post on creating stock charts in Ext JS 4 - http://www.scottlogic.co.uk/2011/12/ext-js-4-stock-charts/. It uses a couple of hundred points and performs fine in modern browsers and isn't too bad in IE7-8. This said however, even after messing with the Ext JS build system, the minimum Ext build required

How can I move to an anchor on a page when I'm using Sammy.js? [duplicate]

孤者浪人 提交于 2019-12-19 08:51:56
问题 This question already has answers here : Closed 7 years ago . Possible Duplicate: How to scroll HTML page to given anchor using jQuery or Javascript? I'm using Sammy.js, and it handles all the client-side URL navigation. I want to navigate to /page#fragment , but the page wont actually go to #fragment . How can I make it do that, either automatically, or by writing code to go to the fragment? 回答1: Sammy doesnt automatically trigger the route, so in your handler you need to add: hash = window

How to use file system or operation using javascript or Jquery?

别说谁变了你拦得住时间么 提交于 2019-12-19 05:07:25
问题 I want to make some file operation using Javascript or jQuery for Cross Browser like: File create File write File read Update Remove/delete Is it possible to do above stuffs? If possible, from where I can get the idea? Please suggest me.In any end (client/server) how can it be done?i asked this just for know! 回答1: No you can't do such type of operation on browser. You need Server Side JavaScript Node.js . There are lot of details in Filesystem Write a file example var fs = require('fs'); fs

Lightweight library for cross-browser event support [closed]

你离开我真会死。 提交于 2019-12-19 04:07:28
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 4 months ago . Cross-browser handling is quite a hassle sometimes. In this case I need to capture quite a number of events, but cannot afford to use a multi purpose library that exceeds 10ish Kb . (e.g. jQuery, Prototype, Dojo, YUI, ...) The script is meant as a basic tracking tool for various sites I'm maintaining. Every

Dojo AMD: Can't call a function inside a require

瘦欲@ 提交于 2019-12-18 13:01:18
问题 I am really a newbie to dojo but as i started developing a new application with dojo version 1.7.2 i also wanted to use the new AMD syntax for functions. Unfortunately i don't seem to get it. :-( What annoys me most is that i can't simply call any function which is inside of a "require"-block. For example i have a page which on opening creates a dynamic table with several widgets in each row. Then i have a button which adds one empty row each time pressed. Without AMD syntax it would be easy:

Dojo AMD: Can't call a function inside a require

一笑奈何 提交于 2019-12-18 13:01:05
问题 I am really a newbie to dojo but as i started developing a new application with dojo version 1.7.2 i also wanted to use the new AMD syntax for functions. Unfortunately i don't seem to get it. :-( What annoys me most is that i can't simply call any function which is inside of a "require"-block. For example i have a page which on opening creates a dynamic table with several widgets in each row. Then i have a button which adds one empty row each time pressed. Without AMD syntax it would be easy:

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

女生的网名这么多〃 提交于 2019-12-18 10:39:50
问题 Closed . This question is opinion-based. It is not currently accepting answers. Want to improve this question? Update the question so it can be answered with facts and citations by editing this post. Closed 5 years ago . I've always been told it's good practice (ala 'unobtrusive javascript') separate JavaScript from HTML markup. However, I've been seeing the opposite trend with a number of new and popular frameworks such as Bootstrap, Angular.js, and Ember.js. Can someone tell me why this isn

Real Time data graph [closed]

淺唱寂寞╮ 提交于 2019-12-18 10:33:48
问题 As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance. Closed 7 years ago . I would like to build a web-based real time data graph and i'm looking at the different options such as: Html5 canvas JS libraries