Tag: json

grunt task with custom json config

i want to create some kind of task where i can read custom configs from different json files, and replace stuff inside my coffee-source files with contents of the json files, and concatenate the source-files. my projekt-setup: ./src file1.coffee file2.coffee ./config /folder1 development.json (contains: {“key”: “value1”} production.json (contains: {“key”: “value2”} /folder2 development.json (contains: {“key”: “value3”} […]

Pulling json data from a web server into text

Hi all I’ve been stuck on this issue for a while. I am currently using dojo.xhrget to put the json data onto my html page as text. At the moment I keep getting the error on safari, it doesn’t seem to respond to other browsers due to cross domain issues i believe – ” An […]

knockout mapping – multiple data sources into one view model

I’m currently trying to break down a large section of data, which is provided by a $ajax call to a .NET webservice, that is causing a script timeout on the page when the data is being mapped to a Knockout view model. I noticed in the documentation that you should be able to bind multiple […]

Backbone error if I have more than 1 JSON group

I’m currently playing around with Backbone.js and have ran into an issue in dealing with JSON and outputting it. The problem I’m have is that my code runs just fine if I have only one entry in my JSON file. However if I add a second, or more, the code fires the error function. I’ve […]

Ajax Post Request Returns JSON but Deferred Fails

I have a cross-domain POST request to http://api.local/user/auth – my API endpoint. I allow Cross Domain requests in my api with CORS. Using Chrome if that makes a difference. I get a valid server JSON response with 200 Status Code but I am using deferreds from a backbone model like so: @model.save() .fail(-> console.log ‘sync […]

Create a Store from a subset of JSON Store

I have a JSON store defined as follows var subAccountStore = new Ext.data.JsonStore({ autoLoad: true, proxy: { type:’ajax’, url : ‘/opUI/json/subaccount.action?name=”ABC”‘ }, fields: [‘accountName’, ‘quantity’,’accountNumbers’], listeners: { load: function(store, records, success) { // ??????? }, single: true } }); and sample data is [{“accountName”:”‘ABC'”,”quantity”:100,”accountNumbers”:[‘12345A’,’12345B’,’12345C’]},{“accountName”:”‘XYZ'”,”quantity”:100,”accountNumbers”:[‘99999A’,’99999B’,’99999C’]}] How do I create a store dynamically for accountNumbers and assign […]

how to make JSON.stringify encode UTF characters

I’m writing a JS that run using windows cscript.exe. My JS is loading JSON object from file, adds a parameter and saves it back to file (using json2.min.js implementation). I’m using JSON.parse(text) to parse the text into JSON object, and then JSON.stringify(text, null, 3) to create the string that I’m writing back. Everything works great […]

How to assign attributes or functions to objects added after DOm ready with jquery

I am working in some personal project it is like the front-end of a chat. So i have my users and i have a JSON with the list of online and offline users. When the website firs load I also load plugins for custom scroll and make elements draggable with jquery ui. what i would […]

Store form data in a array?

Need help storing form data in an array. The form has an option to display additional fields. How do I get the additional field values to display in the data array. <form id=”myForm”> <div id=”input1″ style=”margin-bottom:4px;” class=”clonedInput”> <p>Please Enter Your First Name Last Name</p> <div style=”border:1px solid black;padding:5px”> <label for=”first1″>first:</label> <input type=”text” name=”first1″ id=”first1″ /><br […]

Accessing JSON data when PhantomJS onResourceReceived is triggered (ESPN fantasy football draft app)

So I’m trying to write a hook into ESPN fantasy football’s HTML lite draft page to cross-reference player ranking lists (from a CSV file) to eliminate already-drafted players from the available pool. I’ve done this by hand in the past: but with a 16-team draft by the late rounds, it’s nearly impossible to keep up […]