Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
An AMD module to manipulate the DOM, combining three small libraries that works for me and might work for you
JavaScript
branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
lib
tests
.gitignore
README.md
package.json

README.md

zq

zq integrates three small libraries for DOM operations:

in a similar syntax to jquery but with different intention.

zq is AMD and it is deployed to jam.

Installation

jam install zq

Do not use this project (yet?) if you are not using jam. If you are looking for an alternative to jquery but do not want to use jam, you might want to check ender.

Some examples

define("example", [zq], function($){

  // on dom ready
  $(function(){
    alert("hello dom is ready!")
  });

  // select and connect to an event
  $(".mybutton").on("click", function(e){
    console.log("clicked");
  });

  //chained
  $(".mybutton")
    .html("")
    .append($.create("<a href='aboutme'>about</a>"))
    .on("click", function(e){
      console.log("something")
    });

  //fire events
  $(".something").fire("click");

  //event delegates
  $(".container")
    .on("click", "div.thebutton", function(e){
      console.log("a!");
    });

  //insert after delegates
  $.create("<a href='test'>test</a>")
    .insertAfter(".mydiv span");

});

differences with jquery

Although this might look similar to jquery, it has a lot of differences and there is a bunch of functionality not there on purpose.

This project only combines the three afore mentioned projects for DOM manipulation, and I will never add to this project something like $.post(...). If you want to have a look the differences from the DOM manipulation check the respective websites, there might be good reasons for that.

develop

npm install
npm test

and then open your browser pointing to http://localhost:3000/tests/index.html.

license

MIT

José F. Romaniello 2012

Something went wrong with that request. Please try again.