Lightweight JS AJAX library [closed] - javascript

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
My friend and I have a site (www.rosasecta.com). It uses a lot of Ajax, but it's all by hand, and it's really ugly and hard to dig through. We want to switch to a JS library, but JQuery, Prototype, and Dojo are to large. We just want a small, compact library that can do AJAX cleanly and some basic DOM selecters. Can anybody recommend one?
Thanks in advance.

The selector portion of jQuery, dojo (and some of the other frameworks) is actually available as a separate library, the Sizzle Selector library:
http://sizzlejs.com/
Sizzle purports to be only 4kb minified and gzipped according to their site.
However, with ajax too, I think a customized jquery with only the smallest bits may be the best "complete package". Some of the other libraries like dojo have methods of building them with exactly the features you want, too.
The default jquery minified+gzipped is only 19kb. I think a core build can be done down to only 12kb.

jQuery isn't large at all, and you can use Google's hosted version meaning many of your users won't even have to download it upon visiting your page.
You requested:
Lightweight
AJAX Capabilities
DOM Selectors
You've practically got jQuery already.

jQuery minified at aro 56K is less than the size of a typical JPG file. It will do everything you need and a whooooooole lot more

Zepto.js: http://zeptojs.com/#download (8kb gzipped)

What about MooTools? It won't provide everything jQuery will, but if it will do what you need, it's very small.

Atomic.js , Size is less than 1kb and angular style , simple js library
https://github.com/cferdinandi/atomic
Read more
https://ultimatecourses.com/blog/writing-a-standalone-ajax-xhr-javascript-micro-library

Related

Best alternatives to jQuery on AngularJS [closed]

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
Well, I wish we could list the best alternatives to jQuery for use with AngularJS, taking into account compatibility with AngularJS and the ability to manipulate the styles (css), besides the possibility of using effects such as fadeIn, fadeOut, slideDown, slideUp, etc.
As based on the response to comment propose to take into consideration the following factors:
Compatibility with AngularJS.
Handling of styles.
Handling events.
Effects
...
The idea is that this thread is helpful when alternatives to jQuery to
work with AngulaJS.
Well, I would just use vanilla javascript to do the DOM manipulation. Styles and events would be possible within angular.
And as far as effects are concerned, a simple library like animate.css can help!
So in short,
Compatibility with AngularJS. - Its vanilla Javascript so no issues here
Handling of styles. - By handling of styles, if you mean using conditional styles, it could be accomplished by angular's ng-class
Handling DOM. - Most of the DOM manipulations can be handled by pure javascript. If you still need a lightweight library go for one of these
ryejs or nodelist or use jqlite that comes bundled with angular
Handling events. - As you are going to be using angularJs, I presume you would be using angular's event model.
Effects - Definitely animate.css
tl;dr: Use angular for all of this, not jquery.
First of all, you can(must) do all of this with angular. Or there is no point to use angular at all. I mean this is very bad practice to manipulate dom directly or do other jquery-style things. Angular provide much more modern approach for all of this things (via built-in and custom directives and etc.).
As the second point - what's wrong with jquery? You're able to use jquery with angular. It's a common practice, because some of third-party libs have a jquery dependency.
And the last one - Angular have built-in jqlite inside, so you're able to do some stuff in this way
As a light-weigth alternatives to jquery you can use zeptojs. But again - this is weird. And I didn't sure how much zepto is better than jqlite.
And as a last point - you can do everything with pure js. But you should keep in mind point about browser's support

Node.js drawing on screen [closed]

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 5 years ago.
Improve this question
I've been looking all over the internet for this. I'd like to know if there is any Node.js packages/bindigs/libraries that allow you to make an application that draws on the screen without node-webkit(NW.js)/Electron or other implementations based on browsers. Maybe something that binds to opengl with support for 2D graphics?
Let me know if you know some names or links. If not I might have to write something myself.
Thank you guys.
There is an experimental project : https://github.com/creationix/node-sdl
This basically provides bindings to the SDL library:
Simple DirectMedia Layer is a cross-platform development library
designed to provide low level access to audio, keyboard, mouse,
joystick, and graphics hardware via OpenGL and Direct3D.
If you can get it compiled, you can try the example scripts in nodejs.
node-opencv or OpenCV in general should allow you this. At least it has a HighGUI class, which gives you native window contexts to display image data. With a lot of hacking you can build something you require. But I would suggest using browser contexts and HTMLCanvas anyhow. It gives you all you need out of the box. You just need to set it up properly.
Edit:
As per #Zorgatone's suggestion, GTK could be a very good library for that purpose, though node bindings are very stale.
There are projects that brings
QT bindings to node.js - https://github.com/arturadib/node-qt
GTK bindings - https://github.com/Tim-Smart/node-gtk
WxWidgets bindings - https://github.com/joeferner/wxNode
but unfortunately the last commits seem to be for old node.js versions.
It will be substantial work to make the bindings work with a recent version of node but those a interesting starting points.
V8-GL intends to provide bindings for creating 2D-3D graphics on the desktop with javascript.The Status is not completed yet, but maybe it is enough for what you are trying to do https://github.com/philogb/V8-GL
Another thing i just found out is, that it actually uses immediate mode, which is deprecated but still works.

Code colors in Html using CSS or javascript [closed]

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 have a website and I teach Java on it.
I know html and css if it helps..
I have lectures in my site and in my lectures there are descriptions: in the description I write code sometimes so I made a class for code so everytime I type code I do and it looks good, but not perfect.
I want to make specific words to be bold and in blue or pink color for example.
Is there a way to do it? maybe with javascript?
I know I can create a new class for special words and then to do for example but this will be too much job to write this span every time that it's not worth it.
So is there a way to do it maybe with html5 or js? Thank you.
edit: I use the usefedora.com platform so it's more difficult to do it, does somebody knows how to do it on usefedora's platform?
the thing you are searching for is a codemirror. There are many codemirrors but only one of them is called codemirror.
Code Mirror
There are also solutions that don't require you to write any javascript, using web components.
Prism.js
Here is one that's insanely trivial to use
There are plenty of code to html converters which do syntax highlighting if that's what your looking for e.g.
http://tohtml.com/java/
or
http://hilite.me/
You can take this HTML and use it on your site.
You can also download a jQuery plugin. SyntaxHighlighter is very popular.
The way they work is that you copy the files to your website, and then you just put your code into a tag, and the plugin automatically beautifies your code.
I would recommend choosing one of these libraries- PrismJS, Highlight.js, or Rainbow.
Each is designed for exactly this purpose. You just put your code into the web page, inside an HTML5 code tag decorated with the language name. They will automatically format your code with the necessary markup to attach color styles to. No need for any external tools. The first two provide their own styles as well, the last assumes you'll write your own.

smallest javascript framework [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a book, tool, software library, tutorial or other off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 8 years ago.
Improve this question
What javascript framework like jQuery or prototype is the smallest and has DOM manipulation and animation? I'm looking for something that can be used to build custom "web-widgets" without adding a large footprint on the site size. I absolutely need DOM query by css selectors. Is there anything like this around 5kb minified?
EDIT
should have stated that I need CSS3 selectors cross platform including IE7+
I just can answer this question without a link...
Read the Comparison of JavaScript frameworks in Wikipedia
The second row there is the size of each framework.
Since you didn't specify browser versions or anything, the answer is you don't need any framework. All the current frameworks are written on top of standard JS, so you can just use the functionality directly, and querySelector(All) can handle selector lookups for you.
Your best bet may be to use Sizzle, which is what jQuery uses internally as its selector engine. It supports almost all CSS3 selectors, and the website states:
Only 4KB minified and gzipped
The Sizzle function returns an array of elements. For example:
var elems = Sizzle(".myElems");
take a look at zepto for instance :
http://zeptojs.com/
maybe http://xuijs.com/ could help you or http://quojs.tapquo.com/

Alternatives to YepNope and LabJS [closed]

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 2 years ago.
Improve this question
I am wanting to load javascript and css files via a resource loader. I was originally using LabJs but I found YepNope more elegant and easier to work with in my scenario. However I am finding it devastatingly slow, which is odd as apparently it is comparable to LabJs in speed on most things.
One thing I do have are Etags which I am sure will slow everything down as its still requesting from the server rather than just working off the client cache.
Anyway there isnt much outside of the main YepNope site, and they havent released a new version with the fixes on their issues list in a while, so I was wondering what other options there are out there...
My requirements are:
Needs to load Css and Javascript
Needs to do them all in parallel
Can be loaded via Javascript
I wish YepNope was a bit more active but wanted to weigh up the other options...
I would throw require.js up for consideration. It will dynamically add script and css tags to the <head> so it works nicely asynchronously. It will also optimize all your js into one file so if you project is like mine you'll have dozens of js files in development (I think we have about 100) but only 1 for production.
The only thing I haven't got working yet is the optimization of the css files though apparently it has been done.
Good luck

Categories