JavaScript Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsWeb DesignJavaScript Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old February 1st, 2013, 04:01 PM
grimar2008 grimar2008 is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2013
Posts: 1 grimar2008 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 11 m 31 sec
Reputation Power: 0
JavaScript global object confused

Hi, this is my first question here so I'm sorry if it isn't clear or something.

I've been using an online "server" from parse, and they have some "cloud code" for which you can write in javascript.
Not being a total expert in js I somehow got stuck, and it has to do with global variables and alike.

The code goes like this:

Code:
var json={};
var query = new Parse.Query("Question");
    query.equalTo("imi", imi);
   query.find(
	{
		success: function(results) {
			json.imi=results[0].imi;
		},
		error: function() {
		
		}
		});


Now note what I was trying to do, I wanted to add imi to json object, but somehow it doesn't work. I really don't know where the new json.imi goes to but this code normally works, and I've been through many forums and seen that my coding is OK.
Now, since this query.find is somewhat of an unknown to me (I don't know what kind of a function this is) I really don't know how I could define these objects so they would work.

P.S.
defining var json as window.json doesn't work as this is not a webpage (atleast I think it's because of that).

Reply With Quote
Reply

Viewing: Dev Shed ForumsWeb DesignJavaScript Development > JavaScript global object confused

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap