Giter Site home page Giter Site logo

hanbo386 / node-jquery Goto Github PK

View Code? Open in Web Editor NEW

This project forked from horseaj86/node-jquery

0.0 1.0 0.0 64 KB

jQuery with a thin wrapper for Ender.JS, Node.JS, and other npm-based packaging systems

Home Page: http://jquery.com

License: MIT License

node-jquery's Introduction

Before creating a PULL REQUEST or ISSUE

Please see HorseAJ86#59

SOON TO BE TAKEN OVER BY JQUERY TEAM

When jquery 2.x is published to npm, it will not be backwards compatible with 1.x.

The jQuery team will be taking over jQuery and jquery on npm. In the meantime this repository still exists, but coolaj86 is not maintaining it or pushing new changes to npm. See the discussion in the various issues to know who to contact about what.

DOES NOT WORK ON WINDOWS

Many people are having problems getting this module to work on windows. The failure has to do with building contextify on window. It seems to be a windows environment issue. I don't have access to a windows machine so I cannot explore working through the windows install process. If you figure out how to build contextify on windows please send me working instructions!

Build Status

NPM module 'jQuery' (capital 'Q')

The is a browser CommonJS package for EnderJS, Pakmanager, etc.

npm install jQuery

NPM module 'jquery' (lowercase 'q')

A stupid-simple wrapper over jQuery for Node.JS (server). Currently 1.7.2.

Node.JS

    npm install jquery

    var $ = require('jquery').create();

Examples

    $("<h1>test passes</h1>").appendTo("body");
    console.log($("body").html());

In Node.JS you may also create separate window instances

    var jsdom = require('jsdom').jsdom
      , myWindow = jsdom().createWindow()
      , $ = require('jquery').create()
      , jQuery = require('jquery').create(myWindow)
      ;

    $("<h1>test passes</h1>").appendTo("body");
    console.log($("body").html());

    jQuery("<h3>second test passes</h3>").appendTo("body");
    console.log(jQuery("body").html());

Output:

    <h1>test passes</h1>
    <h3>second test passes</h3>

You may also specify the version of jQuery you'd like to use

    var $ = require('jquery')(null, '1.9');

Currently the version defaults to 1.8.3.

Following versions are available -

  • 1.6(.4)
  • 1.7(.2)
  • 1.8(.3)
  • 1.9(.1)
  • 2.0(.0)

JSONP Example

    var $ = require('jquery');

    $.getJSON('http://twitter.com/status/user_timeline/treason.json?count=10&callback=?',function(data) {
      console.log(data);
    });

Building/Publishing to NPM

grunt && npm publish

node-jquery's People

Contributors

treasonx avatar netroy avatar azatoth avatar laurie71 avatar linuxwolf avatar elliotttf avatar squanto avatar tf avatar

Watchers

 avatar

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.