GithubHelp home page GithubHelp logo

mw-simple-query's Introduction

MW Simple Query

A simple javascript DOM manipulation library.

It allows convenient access to native DOM/element methods with method chaining.

This is NOT a cross-browser compatibility library like jQuery.
It works (and is tested) on current standards-compliant browsers like Firefox 19 and Chrome 25.
It may work in others.

Short introduction

If you already know jQuery, this should look familiar.

<!doctype html>
<html>
<head>
	<meta charset="utf-8">
	<title>Demo</title>
</head>
<body>
	<h1>Demo</h1>
	<script src="mw_simple_query.js"></script>
	<script>
	(function ($) {
		$.onDOMReady(function () {
			$('h1').style('cursor', 'pointer').onClick(function (e) { $.wrap(this).style('color', 'red'); });
		});
	}(window.simpleQuery));
	</script>
</body>
</html>

API

API Documentation

QUnit tests

Just run tests/qunit.html to run the tests in your browser.
They run fine in current versions of Firefox and Webkit based browsers.
In Opera the library seems to run fine, but there are problems with the unit tests.

License

MIT License, see LICENSE.txt

Notes

  • As soon as I tried to learn how to deal with native DOM manipulation with javascript, I started to developing this library.
    As someone well known said, the DOM is a mess.

  • If it looks like reinventing the wheel see this link.

  • I use this library instead of jQuery in a well defined environment, node-webkit, where browser compatibility is not a necessity.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.