1

I think this issue getting because jquery not working,so please help me how can implement jquery in my main.js (express.js controller ) at parse.com

What i want to do

Download image from parse cloud and further render that image in view template (in .ejs file)

but i got $ is not defined in parse.com log

I have also added line require('cloud/jquery.min.js');

my code

 /**
 * get user image
 */
app.get('/getUserImageAction',function(req,res){
var Documents = Parse.Object.extend("Documents"); // Documents class
var query = new Parse.Query(Documents); 
query.equalTo("imageOwner","234");
query.find({
success: function(imgObjects) {
var documentImage = imgObjects[0].get("imageFile");

$("documentImage")[0].src = documentImage.url();
Parse.Cloud.httpRequest({ url: documentImage.url()      }).then(function(response) {
// The file contents are in response.buffer.
   res.render('viewDocuments.ejs',{image:response.buffer});
  });
  },
 error: function(object, error) {
  res.render('hello.ejs',{message:+ error.code + " : " + error.message});

}
});
});

2) second is when comment that line, I am getting something in imgObjects but got this error at parse log.

Result: Script ran out of memory

5
  • Where did you get from the jQuery library? Is it a nodejs module? Commented Aug 1, 2015 at 13:27
  • i have deployed jquery.min.js in parse.com cloud folder and this code puts in main.js Commented Aug 1, 2015 at 13:29
  • This is the jQuery library for nodeJs: npmjs.com/package/jQuery Commented Aug 1, 2015 at 13:31
  • I have execute this command ` npm install jquery` but at which location installed and should deploy again that file on parse. Commented Aug 1, 2015 at 14:33
  • its resolved now.!! enjoy coding. Commented Aug 7, 2015 at 13:55

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.