quirkey / the_json_store Goto Github PK
View Code? Open in Web Editor NEWCode for the Sammy Tutorial series
License: MIT License
Code for the Sammy Tutorial series
License: MIT License
I really appreciate this example. I had to do a few things to get it working with VS and IIS. Notably, you have to have a web.config and within web.config you add the following:
<system.webServer> <staticContent> <mimeMap fileExtension=".json" mimeType="application/json" /> <mimeMap fileExtension=".template" mimeType="text/template" /> </staticContent> </system.webServer>
It is also necessary to create a Virtual Directory in IIS to the project. From there you you change the path in json_store.js to get around CORS and Chrome issues.
this.around(function(callback) { var context = this; this.load('http://localhost/yoursite/data/items.json') .then(function(items) { context.items = items; }) .then(callback); });
Very nice tutorial, but it seems not working on Chrome.
I tried Safari and Firefox and all went well, but on Chrome
$.ajax({
url: 'data/items.js',
dataType: 'json',
success: function(items) {
$.each(items, function(i, item) {
context.log(item.title, '-', item.artist);
});
}
});
});
return a parserror
I have created a few helpers that produce HTML, however, all output from <%= %> seems to be escaped. Is there away to override this behaviour ?
if not, could this functionality be considered in future updates? I much rather have the option (a option as to maintain backward compatibility) to disable this feature so all output is raw and then create a helper to escape output when required on a per item bases. Perhaps such a helper could also be included?
I've download example (zip file), but its not working. Any ideas?
Edit: probably something with context.render?
Hello. Great tutorial! I am looking into it enthusiastically, btw, in the first part the link to jQuery seems to be old, it has moved, so a good replacemente could be:
http://ajax.googleapis.com/ajax/libs/jquery/1.5.2/jquery.min.js
Regards
Hi! Just stumbled onto your project. It's awesome! You've done some great work and I'm considering using this in production already.
The problem I'm having is that I keep getting my first three items replaced by http://github.com/lgomez/sammy-test/blob/master/javascripts/app.js#L23-25. The items are all being loaded and $.each(context.items, function(i, item) {
is running four times. But the result I get is a single item in #main (which in my case is #content). This is the entire content of the items section as shown by firebug: http://github.com/lgomez/sammy-test/blob/master/result.html.
I've looked through the code, tried your version, copied your app.js file from this project exactly as it is, etc... but still get the same problem. I can't see it. Thoughts?
Thank you!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.