Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 3 years ago.
Improve this question
I am writing a lot of web applications that requires a lot of dynamic content that is replaced according to various ajax request to the PHP+mySQL backend that is able to respond all data as JSON. This could be something like quizzes, polls or it could also be more advanced applications that requires more updates of the DOM.
The point is that the integration with the HTML (wich is coded by a third part) is as easy as possible.
Since this are many small applications and not a big site, I am looking for a library that helps me get the job done fast and easy to customize later on.
I don't know the best way of doing this but know that there are various libraries out there that does what I need (and a lot more).
Required features:
Lightweight
Easy to update the HTML structure (even for HTML-only coders)
Compatible with jQuery
Works with all modern browsers including Chrome, Firefox, Safari and IE7+
Works with all mobile browsers including Android, iOS and Windows Mobile
I would try Distal.
You said your HTML is coded by a third party so you would want minimal changes during integration. With distal you add stuff to the existing HTML and don't need to move things around.
The syntax is HTML based so it's suitable for HTML only coders.
Mustache is pretty solid, but I found it to be a little too hardline about the "logicless template" thing. For example, it doesn't offer a lot of small niceties you'd hope for in a templating system, like an "else" statement. You have to do dumb stuff like this all the time:
{{#if foo}}
<span>foo is set</span>
{{/if}
{{^if foo}}
<span>foo is not set</span>
{{/if}}
Instead, I'd recommend Handlebars which is built on top of Mustache, but adds some nice features like custom helpers and better context-switching support.
I would try mustache. I've used it in the past and it's pretty good; fast and intuitive.
Try JUST. It has similar syntax with EJS but more it powerful. It have very useful features like inheritance, partials and block redefenitions. It work on client and server (node.js) side.
Related
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 8 years ago.
Improve this question
I'm a PHP programmer that was just hired to write an interactive ipad app whose requirements are basically that it be a website. So I started setting up to develop a website when I found out that my employer's server has been lobotomized: no dynamic languages, the only things I'm allowed to code with are HTML and JavaScript.
AJAX and jQuery are still in, but as far as I can tell they won't have a server-side language to back them up. If I have an urgent and compelling reason to have an active language, I might be able to convince the senior web guy to give me an exception, but I don't think my project qualifies as urgent or compelling by about two orders of magnitude.
My question then, is what sort of labor-saving devices are out there for HTML/JS only sites? I would have liked to use something like Drupal. Would I be better off writing the whole thing in XCode?
The site will display information regarding a number of historical artifacts in the possession of the library that is my employer.
It would help if you were more specific about your needs (the kinds of things you do in PHP that you don't know how to do with just HTML/JS), but I think I know what you're getting at.
If the site isn't too complicated, a good client-side templating engine is probably what you're looking for. Handlebars.js is a popular choice, but there are tons to choose from. I prefer to use client-jade, but it doesn't matter much. The idea is to define a template (e.g. for displaying one historical artifact), then iterate over an array of data that describes all the artifacts in the library, rendering each element of the array into some pretty-looking DOM with your template.
If you need something more sophisticated than that, you might want a client-side MVC framework like Backbone.js (lightweight, easier to learn, less opinionated) or Angular.js (heavier, harder to learn, very opinionated).
If the labor you're trying to save yourself from doing is styling work, you might want to check out twitter bootstrap (or similar frameworks like foundation). Bootstrap makes it easy to create good-looking navbars, make column-based layouts, and ensure that your site looks good across different browsers and devices.
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 8 years ago.
Improve this question
I am acting as web developer for a small startup, taking over as the only in-house developer to maintain and adapt the application that was initially put together by a team of contractors. I would consider myself to be at an intermediate level with Ruby on Rails. I know enough about front end technologies like HTML and CSS to use Bootstrap or Foundation effectively and write my own tweaks when necessary. However, I only can read the JavaScript code of other developers well enough to make small modifications to what's already in place.
I would like to become proficient in JavaScript to help round out my skillset but there seem to be a lot of JavaScript "options" out there and I'm not sure what's on the way in, what's on the way out, what's popular, what's most useful, easiest to start with, best fit for Rails applications and so forth. And by "options" I mean "regular" Javascript, jQuery, Node, Angular, etc etc.
In hopes that my question will meet SO terms as "answerable" I'd like to focus on the question of what kind of Javascript fits best with Rails and which technologies are the most generally relevant today (i.e. not on the way out of popularity already).
Your choice should depend on what you're doing. One case might be using Rails primarily on the back-end, pulling data from it, and then generating your markup and displaying content primarily on the front-end with JavaScript. In that case, you should look into a JavaScript framework like Ember.js or AngularJS. If you're going to be generating your markup primarily on the back-end with Rails, having that markup being pre-populated with content before being sent to the user, you might be better off using jQuery for DOM manipulation and the occasional AJAX request to your Rails back-end.
In the case you're looking for a framework: Yehuda Katz is a leading voice in the Ruby on Rails core team, and has a similar role inside of the Ember.js project. While this isn't strictly objective, I'd say that Ember is the JavaScript framework that most closely matches "The Rails Way". That said, any framework will integrate well if you're using Rails as a backend, and AngularJS is currently more popular and might be easier if you're looking for examples and helper libraries.
I'd like to point out that Ember is just a framework, just like jQuery is just a library. Knowing JavaScript from the bottom up is a very helpful thing when working with anyone's code. I highly recommend checking out the Learn JavaScript page on MDN, and maybe picking up a copy of JavaScript: the Good Parts by Douglas Crockford. The former has a bunch of free information about getting up to speed on JavaScript. The latter is a dense, and somewhat controversial book, but (in my opinion) is one of the best books about dealing with the language's rough edges.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 3 years ago.
Improve this question
I need to develop quite simple web application with some Ajax functionality and GUI components with Java as a server-side language. The main purpose for me is to learn sth about designing web app that I can make use of when I start looking for a job ... .I ran into lots of framework (RAP, Nice JSF implementations etc.) and there are also GWT and JQuery . I started reading about GWT and it seems to be great at the beginning, but there are limited number of visual components. When You missed one it seems to be much harder to write it with GWT than in JavaScript/JQuery (e.g sortable components).
Also:
If JavaScript is is easy why to learn API to just make translation?
The main argument seems to be that GWT is for developers who don't
know Java Script very well, but is JS harder than GWT API and
configuration to work with?
GWT offers also very nice Remote Procedure Call and translating
objects to JS, but there are lots of libraries like DWR.
You need also to use standard servlet to e.g send file stream to a
user, so You need also to save it to a Database or as a hidden XHTML files to make them available to servlet.
So should I start to learn GWT? It is really wide spread? Or maybe JSF implementations with Ajax support outperforms GWT in usability? The biggest problem I have that I cannot imagine how to solve simple problems in GWT while they are almost complete solutions with JQuery. Mixing JavaScript native code with GWT don't seems to be a good option also.
When working with GWT, its always better to now whats going on behind. So you have to learn HTML, CSS and JavaScript as anyway. Maybe you can start with less knowledge on browser frontend technologies. But you will come to the point where you need to know whats going on.
So ask yourself. Is your app large enough that its worth to start with complex GWT app. Also if you're on a large team and familiar with JAVA, Maven and Junit it makes senses.
On the other hand there are a bunch of small (backbone.js with jquery), middle (mootools) or large (extjs) JavaScript frameworks to build RIA.
I've never work with JSF, but all people a meet that used it, wasn't really satisfied.
After all I dont think its a good idea to select a framework by the current feature set of your app. As this can change of the time, you will have to implement it later with a technologie you not familiar with.
Note there is a table sort library for GWT as well: http://code.google.com/p/gwt-advanced-table/
GWT contains several unique features which make it difficult to be compared with other frameworks. The key point is that GWT isn't just a framework or library -- it's a toolkit. Consider:
Ability to use Java IDE's and debugger during development
Automatic generation of compiled scripts optimized for different browsers
Benefits of java for organization of code-base: OOP, package system, checked exceptions, compile-time type-checking etc.
These features make GWT suitable for big projects built by large teams that should be enhanced and maintained over a large time-frame. Off course, many projects do not have such requirements and therefore developers should give more weight to other consideration like widget library and learning curve.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 6 years ago.
Improve this question
Is there any python module for rendering a HTML page with javascript and get back a DOM object?
I want to parse a page which generates almost all of its content using javascript.
The big complication here is emulating the full browser environment outside of a browser. You can use stand alone javascript interpreters like Rhino and SpiderMonkey to run javascript code but they don't provide a complete browser like environment to full render a web page.
If I needed to solve a problem like this I would first look at how the javascript is rendering the page, it's quite possible it's fetching data via AJAX and using that to render the page. I could then use python libraries like simplejson and httplib2 to directly fetch the data and use that, negating the need to access the DOM object. However, that's only one possible situation, I don't know the exact problem you are solving.
Other options include the selenium one mentioned by Łukasz, some kind of webkit embedded craziness, some kind of IE win32 scripting craziness or, finally, a pyxpcom based solution (with added craziness). All these have the drawback of requiring pretty much a fully running web browser for python to play with, which might not be an option depending on your environment.
You can probably use python-webkit for it. Requires a running glib and GTK, but that's probably less problematic than wrapping the parts of webkit without glib.
I don't know if it does everything you need, but I guess you should give it a try.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 7 years ago.
Improve this question
Many languages have standard repositories where people donate useful libraries that they want others to have access to. For instance Perl has CPAN, PHP has PEAR, Ruby has RubyGems, and so on. What is the best option for JavaScript?
I ask because a few months ago I ported Statistics::Distributions from Perl to JavaScript. (When I say ported I mean, "Ran text substitutions, fixed a few things by hand." I did not rewrite it.) Since I've used this module a number of times in Perl, I figure that statistics-distributions.js is likely to be useful to someone. So I've put it under the same open source license as the original (your choice of the GPL or the Artistic License). But I have no idea where to put it so that people who might want it are likely to find it.
It doesn't fit into any sort of framework. It is just a standalone library that gives you the ability to calculate a number of useful statistics distributions to 5 digits of accuracy. In JavaScript.
JSAN (JavaScript Archive Network) sounds like the kind of thing you're looking for, but I've never personally used anything from it apart from Test.Builder.
As long as your JavaScript can be dropped in to people's projects without polluting the global namespace or doing things which are liable to cause breakage in other people's code (adding to Object.prototype, for example) I would just stick it somewhere like Google Code as already suggested.
There is no centralized repository for JavaScript. JS Libraries usually have their own plugin-repositories, but for stand-alone scripts, The best way to promote it is to send it to famous website such as ajaxian or mashable
AFAIK, there is no central JavaScript repository, but you might have success promoting it on Snipplr or as a project on Google Code.
You could start a project on SourceForge to contain useful snippets of code like this (or google for snippets to find one).
Perl, Ruby, PHP, etc all have distribution mechanisms built into the language to consume such libraries.
There's not such a thing built into JS.
There are tons of script archives out there - but no "central" JS repo.
Consider packaging it up as a plugin for one of the major Javascript libraries such as jQuery - see http://docs.jquery.com/Plugins/Authoring for more details. This way it can be included on their plugin page which will get it good exposure as they have a huge developer base and it'll be one of their first ports of call when a need arises for such functionality.
Whilst jQuery is one of the most popular frameworks (if not the most) out there, there are a host if other libraries you could consider using in addition to/instead of it.