Use this tag for questions related to JavaScript objects.
3
votes
1answer
889 views
error with google swiffy calling runtime.js multiple times in the same page
I have converted multiple swf files using google swiffy v5.2 and will have my new animations displayed on many different pages, most of which I do not have control of or access to. In order for the ...
2
votes
1answer
221 views
Best Practice to import Jvectormap jQuery file into MySql
I'm trying to place SVG data into a MySQL Database without copying and pasting over 200 rows.
Is there any way to import the following into a MySQL Databases:
"LR": {
"path": ...
2
votes
1answer
242 views
Titanium Mobile Controller troubles
Ok so Im working on a mobile app and I wanna make sure my structure is right so I can continue to add more complex things.
Basicaly I am asking if this is the best way to do this.
this is my ...
1
vote
1answer
17 views
Save the order in Object while inserting numerical keys
I'm parsing an XML and building an object with those values.
I have the parse parseXmlByTag() function which parse by specific TAG - its works good, so consider it is returning what it should return.
...
1
vote
1answer
52 views
Javascript: Storing objects as values in a hash
I'm very new to javascript, I'm not sure if its possible to do this.
I'm trying to store Chart objects (from Chartjs.org) as the value in a hash, the keys are strings. When the following code is run ...
1
vote
1answer
117 views
How do i add a Javascript object for a User control in ASP.Net
I have a User control and i have a method isDirty() added to this user control.
This user control is used in many places.
How do i access this method using javascript .How do i create a javascript ...
1
vote
1answer
8k views
Objects inside objects in javascript
I'm somewhat new to Javascript, so maybe this is just a noob mistake, but I haven't found anything that specifically helps me while looking around. I'm writing a game, and I'm trying to build an ...
0
votes
1answer
23 views
Javascipt nested object default value
So if I have an object defined like so:
var object = {
prop1: 'val1',
prop2: 'val2',
prop3: {
subprop1: 'subval1',
subprop2: 'subval2',
subprop3: 'subval3'
...
0
votes
1answer
24 views
How to filter/search multidimensional array of objects?
I have a data structure like below:
var options = [{
name: "Option One",
foo: "bar",
values: [{
name: "Value One",
value: "Value",
options: ...
0
votes
1answer
46 views
Trying to get string from HTML input and use it to create new object
So I am making a simple application to get stock summary info from Yahoo using a YQL statement to return a JSON. Thus far, I don't have a lot of code as I am simply trying to establish the basic ...
0
votes
1answer
83 views
Create objects in a loop with onclicklistener in JavaScript phaser game framework
I'm trying to create an easy quiz game which displays a question and 5 variants of answers.
I work with phaser.js but I think it will applicable for JavaScript in general.
Here is my function that ...
0
votes
1answer
31 views
for loop error, for loop is not populating my array properly
I am doing regression analysis with javascript. I am trying to get the ui(the error value) from a stock price using the regression line. My regression line is in an array called line. My code is as ...
0
votes
1answer
41 views
jQuery sort elements by position in page
I want to sort elements by position in the page. Meaning if I have an object:
$obj = $('#div1, #div2, #div3');
But my markup is like:
<div id="div3"></div>
<div ...
0
votes
1answer
53 views
Jquery/JS - Create Objects Dynamically For Each Div Within
Backstory: So I wanted to build a JS library for my own interface webpages. The result is, if I add <div class="window SOMENAME"></div> within my div#Environment. The webpage will ...
0
votes
1answer
11 views
JavaScript program should print hoe many years you got till retire
I wrote a javaScript program that spoused to give how many years you got till retire but as expected it does not work can someone help me figure it out?
<html>
//27:
function ...
0
votes
1answer
39 views
Whats wrong with my JavaScript code?
// Our person constructor
function Person (name, age) {
this.name = name;
this.age = age;
}
// We can make a function which takes persons as arguments
// This one computes the ...
0
votes
1answer
50 views
Failing to push to Knockout observable array
I'm trying to push some data to a KO observable array. I'm getting data from my AJAX call and I get no errors when my script executes. However, if I try to access userNames, I get an empty array. ...
0
votes
1answer
16 views
Saving a particular Objects property in localstorage
The standard
localStorage.var = var;
Isn't working for me, for example:
localStorage.library_science1.owned = library_science1.owned;
Where library_science1 is a previously created Object with ...
2
votes
0answers
627 views
Synchronous vs. asynchronous for publish subscribe communication between JavaScript objects
I implemented the publish subscribe pattern in a JavaScript module to be used by entirely client-side oriented JavaScript objects. This module has nothing to do with client-server communications in ...
1
vote
0answers
92 views
JQuery grep - returning data with 2 parameters
So I have an array of objects, many of which have duplicate key properties, since some are dynamically created replications with a few, non-specific fields subject to change.
var myArray = [
{Name: ...
1
vote
0answers
143 views
C# 'ref' keyword equivalent or workaround in Javascript
If I have a object:
var Edge = function() {
this.a = 0;
this.b = 0;
this.prevEdge = null;
this.nextEdge = null;
// +20 other members
}
and a function:
function ProcessEdge(e)
{
// some ...
1
vote
0answers
52 views
What are the drawbacks of this Classing format?
This is a 3 layer example of my classing format
function __(_){return _.constructor}
//class
var _ = ( CLASS = function(){
this.variable = 0;
this.sub = new CLASS.SUBCLASS();
}).prototype;
_.func = ...
1
vote
0answers
566 views
Titanium mobile Javascript objects
Ok so I'm new to Titanium and I'm pretty much a noob at Javascript
I tried doing this:
app.view.newMatrix = function() {
return {
matrix = Titanium.UI.createWindow({
title:'Add a New ...
0
votes
0answers
67 views
$.each on an object, returning empty child object
I'm somewhat a JS newbie and I'm having an issue..
I have an object with child objects :
And I'm doing a jQuery.each on it to deal with each object individually :
findResultPersonality: ...
0
votes
0answers
25 views
Declared variables cannot be deleted in javascript
As per the MDN, Declared variables are a non configurable property of their execution context(function or global). Undeclared variables are configurable(e.g. can be deleted).
When I tried deleting a ...
0
votes
0answers
27 views
JavaScript Object instantiation within another Object methods
I'm trying to figure out how to handle the situation, where you have several objects under the same namespace, where methods of all of them might be used interchangeably - i.e. first object might be ...
0
votes
0answers
23 views
Javascript object property logs normally but is undefined?
I have a Javascript object that gets initialised in an asynchronous manner, later edited and then stored in an array until it can be saved. The problem is that one of the checks it goes through is ...
0
votes
0answers
32 views
Mongoose not saving nested object
I'm puzzled as of why Mongoose isn't saving my object:
var objectToSave = new ModelToSave({
_id : req.params.id,
Item : customObject.Item //doesn't save with customObject.getItem() neither
});
...
0
votes
0answers
29 views
How to create objects from a list of objects in javascript using parse.com?
I have this, is javascript and parse (backend)
obtenerArticulos: function(categorias){
var queryAllArticles = new Parse.Query("Articulo");
queryAllArticles.equalTo("lugar", ...
0
votes
0answers
23 views
Type error when accessing object value on chart.js
I am using http://www.chartjs.org/ for pie chart
there are more than 20 charts have to be draw, so I am using objects and for in loop to access and render each map.
It's working good when approach ...
0
votes
0answers
34 views
UnderscoreJs how to throw error by testing objects key and get the ignored or added keys?
Here is my scenario i have 2 objects, one is static another one is dynamic (fetching from url), i am doing the validation both using my static and uri objects.
the intension is i would like to throw ...
0
votes
0answers
54 views
open many webpages with phantomjs
I use phantomjs to get some data from some websites that update automatically every second with ajax. These websites update for 3 hours, so we need to get some data from them every second for that ...
0
votes
0answers
25 views
Run user created method in an element object from the element returned by getElementById
I have created an Object Method in a "Div" DOM Object, I call it squishy.
document.getElementById returns my "Div" Element. How do I run "squishy" from the returned element?
I tried squishy directly ...
0
votes
0answers
39 views
array return type different in JSNI function and plain javascript?
have a javascript function ( port of Stefan Goessner's xpath for json @ http://goessner.net/articles/JsonPath/ )
- which I am trying to port to JSNI for use in GWT app.
I have Javascript Overlay ...
0
votes
0answers
99 views
set property for javascript object in angularjs
Below javascript code is executed in browser. How can I set photopath property of person object to get the right result "/image/john.jpg" when I run the command console.log($scope.person.photopath); ...
0
votes
0answers
126 views
Programmatically Adding Attributes to JS Object
My post title is deceivingly simple, I think, because the specific question that I have is a bit tricky.
I need to add an attribute to a Javascript object. The attribute is a date and has to be in ...
0
votes
0answers
49 views
Javascript's Object has different data at a time
for(var i=0; i<Elements.length; i++)
{ if( Elements[i].y < 0 )
{
console.log({y:Elements[i].y, E:Elements[i]});
}
}
==========================================================
...
0
votes
0answers
60 views
javascript replacing an object with an object
I have a javascript object that looks like this (don't judge me).
{88:{1:{nTextID:179,bPublished:1}},
89:{1:{nTextID:22,bPublished:1},
2:{nTextID:22,bPublished:1}
}
};
at some point in my ...
0
votes
0answers
32 views
access dynamically generated nested object name
I'm creating a nested object with random characters dynamically on page load. I can't figure out how to access the names dynamically. I'm using a library that needs the name of these objects to ...
0
votes
0answers
83 views
How to get multiple images from a prototype object in javascript?
im trying to figure out how to get multiple image objects with a prototype object. I know for a fact I can get 1 instance of an image.. But I would like to declare multiple images from an array and ...
0
votes
0answers
80 views
“Object doesn't support this action” when “newing” a nested Javascript object instance
I have created a "Namespace" of sorts using nested objects in Javascript and am trying to "new' up an instance of a javascript object.
//
// Create the ABC.DTO "namespace"
if (typeof (ABC) == ...
0
votes
0answers
163 views
Climbing up a Javascript object tree/level?
I may be wrong from the outset in that this cannot be done natively in an easier way, e.g. there are no inbuilt keywords/variables etc for this kind of thing.
Let's say I have the following ...
0
votes
0answers
272 views
recursively extending and merging javascript objects
I have written two methods for extending and merging javascript objects. It might be bad question, but I'm not sure that I'm doing it right. Can you look at code and tell if I need something to ...
0
votes
0answers
123 views
How to console log single object value rather then all?
I'm simply trying to fix my code. It appears when I click one of the names in the list as shown below, rather then console logging the name clicked, it will console log the name clicked, plus each ...
0
votes
0answers
49 views
object oriented javascript - inheritance implementation
I have two module with very similar methods (it is a part of an adapter pattern that implements the same methods/interface). The differences are in two lines of code:
function MyModuleA{
}
...
0
votes
0answers
60 views
JavaScript object - error when calling a method
Within one of the methods of a JavaScript object I'm building - open() -, there is a call to a previously defined method of the same object - close(). When calling the open() method, I get the ...
0
votes
0answers
395 views
Accessing json object when property information is dynamic
My server response is as follows:
{
data : [
{
name: "ADeal",
image: "images/adeal.png",
},
{
name: ...
0
votes
0answers
94 views
Detect event object in ie7
I have a little problem in ie7. In ie8+ I can detect the Event object with this code:
event instanceof Event
or
event.constructor === Event
but in ie7 I have no Event object, so the question ...
0
votes
0answers
298 views
fullcalendar pushing the end date into an array
In some possibly sub-optimal manner, I'm trying to push event data into an array when it is dropped onto the calendar, or indeed if it is edited. I can do this for the start time and the title, but ...
0
votes
0answers
486 views
Deleting javascript object instances
I use spryvalidation in my forms, a situation comes when i create input elements dynamically which then create the validation instances dynamically. the problem comes when a user tries to delete an ...