Skip to content

nodeQuery not working.  #3

Description

@geekyme

@tblobaum I need help trying to make nodeQuery work. I'm following your usage instruction. the html code below is deliberately modified to prevent github from escaping the tags.

folder:

nodeQueryTest
-- app.js
-- public
----- test.html
-- node_modules
----- express
----- dnode
----- nodeQuery

app.js code:

var Express = require('express')
, dnode = require('dnode')()
, nQuery = require('nodeQuery')
, express = Express.createServer()

var app = function ($) {
$.on('ready', function () {
$('body').append('Hello World')
})
}

nQuery
.use(app)

express
.use(nQuery.middleware)
.use(Express.static(__dirname + '/public'))
.listen(3000)

dnode
.use(nQuery.middleware)
.listen(express)

test.html code:

!doctype html
html
body
script src='//code.jquery.com/jquery.min.js' charset='utf-8'
script type='text/javascript' src='/nquery.js' charset='utf-8'
/body
/html

Output ERROR:

C:\Users\shawnlim\Documents\Websites\nodeprojects\nodeQueryTest>node app

C:\Users\shawnlim\Documents\Websites\nodeprojects\nodeQueryTest\app.js:21
.use(nQuery.middleware)
^
TypeError: Object # has no method 'use'
at Object. (C:\Users\shawnlim\Documents\Websites\nodeprojects\nod
eQueryTest\app.js:21:4)
at Module._compile (module.js:449:26)
at Object.Module._extensions..js (module.js:467:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Module.runMain (module.js:492:10)
at process.startup.processNextTick.process._tickCallback (node.js:244:9)

C:\Users\shawnlim\Documents\Websites\nodeprojects\nodeQueryTest>

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions