Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nodeQuery not working. #3

Open
geekyme opened this issue Nov 16, 2012 · 1 comment
Open

nodeQuery not working. #3

geekyme opened this issue Nov 16, 2012 · 1 comment

Comments

@geekyme
Copy link

geekyme commented Nov 16, 2012

@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>

@geekyme
Copy link
Author

geekyme commented Nov 16, 2012

@tblobaum I got it working already under the following versions:

dnode 0.9.1
nodeQuery 0.0.8-9

Could you update the project to be compatible with latest dnode and express 3?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant