I have the following native method in a extended JavaScriptObject class:
public final native boolean getDelete() /*-{ return this.delete; }-*/;
but this apparently doesn't work as "delete" is an javascript operator.
How can I read this property correctly.
The thrown exception is:
com.google.gwt.dev.js.JsParserException: missing n...
I have a JavaScript object that looks like the following:
venue = function(map, dataSet) {
// set some constants
this.VENUE_ID = 0;
this.VENUE_NAME = 1;
this.VENUE_CITY = 2;
this.filterBy = function(field, value) {
...
var filterValue = 'parent.VENUE_' + field;
}
}
Now, the problem is that I ne...
Let's say I have a function which is being passed a string which originally came from getElementById, and I have an object with the same name as that string's value, is there a way to call that object? I won't know which object I want until I get that value from the element's ID.
For Instance:
StartingFunction(SomeID){
someVariable = d...
I've created a JavaScript object to hold onto a value set by a user checking a checbox in a ColorBox.
I am relatively new to jQuery and programming JavaScript "the right way" and wanted to be sure that the below mechanism for capturing the users check action was a best practice for JavaScript in general. Further, since I am employing jQ...
Mozilla & IE developers seem to have simultaneously changed the implementation of their height elements to represent the Opera implementation... which I previously did not have to worry about.
var height = (document.height !== undefined) ? document.height : document.body.offsetHeight;
When performed on a blank document now returns 0 as...
Ok, so this shouldn't be difficult, however I have encountered weird and bizarra flukes.
I am trying to pack a tree into an array, where each node is something like:
title: string-for-display
key: id-value
children: array of child nodes
the fluke is so strange I can't comprehend it at all: when I try to add a child to a node, I do...
I'm a relatively newbie to object oriented programming in JavaScript, and I'm unsure of the "best" way to define and use objects in JavaScript. I've seen the "canonical" way to define objects and instantiate a new instance, as shown below.
function myObjectType(property1, propterty2) {
this.property1 = property1,
this.property2...
Hello!
In my JS, I have an object called box_object.
It looks like this:
({ id:"3",
text:"this is a box object",
connection_parent:["1", "2"],
connection_child:["5", "6"],
connectiondata_child:{
0:{id:"5", linepoint:"bottom"},
1:{id:"6", linepoint:"bottom"}},
connectiondata_parent:{
0:{id:"1"...
Sometimes JavaScript doesn't make sense to me, consider the following code that generates a photo mosaic based on x/y tiles. I'm trying to set a .Done property to true once each Mosaic image has been downloaded, but it's always false for some reason, what am I doing wrong?
var tileData = [];
function generate()
{
var image = new Im...
Is there a reason for object functions to be unset or deleted or simply not applied for any reason at all that isn't intentional?
I am maintaining someone elses code and gone through it many times. I use Google Chromes awesome debuger and also TextMate. These help me find the origin of error relatively fast.
The problem I have now is ...
Ok, Im wondering if it is possible to transfer the reference of the object to the functions. If you dont understand what im trying to say, this might help:
//so i declare the variable `Editor`
var Editor = new (function(e, d){
this.edit = e;
this.dyna = d;
this.old = ""; //and set these variables inside the object
this....
I have an array of existing object defined with JSON. The objects are obviously of the Object type. How do I associate them with a custom object type to give them specific functionality?
...
This is the first time I've used JS objects and I'm confused as to why this property is always undefined:
function Rotator() {
this.interval = 300;
this.image = 0;
this.images = undefined;
}
Rotator.prototype.Fetch = function(links) {
console.log("Fetch called");
this.images = links;
}
Rotator.prototype.Current = f...
i noticed that certain code that evaluates some shoe sizes JSON for an e-commerce site and outputs them on screen is messing up the order in chrome.
the JOSN string given can be:
{"7":["9149","9139","10455","17208"],"7.5":["9140","9150","10456","17209"],"8":["2684","9141","10457","17210"],"8.5":["9142","10444","10458","17211"],"9":["26...
Hi,
is there a way to modify the values of a status field in the colModel dynamically?
Lets say we have a col Model with a field like:
... field ... name: "state",type: "select",
editoptions: {value: "0:state0;1:state1;2:state2;3:state3;4:state4"}
So I get a select field for my states with this values. But I need to dynamicaly decide...
I have two ajax functions and use the first one to pass some data to the second however when I look at the POST, I see that for the variable I am being sent I am getting object Object returned as the value of the variable and not what I was expecting either a string or an int. The javascript looks like this,
$('.career_select .sele...
I have the following snippet of JS
var Customer : function()
{
this.ShipProduct : function()
{
//Logic for shipping product. If shipping successful, notify user
//Here I am trying to call Notify
//this.Notify(); // does not work
}
this.Notify = function()
{
//Logic for notify
}
}
How...
In my javascript objects i found myself writing this:
this_object = this;
It seems it's the only way to pass member variables to external functions...
google.maps.event.addListener(this.marker, 'click', function() {
this.info_window.setContent('Chicago marker');
this.info_window.open(this.map,this.marker);
});
That doesn't ...
The following will show in Firebug or in jsconsole.com or in other Javascript interactive console:
>>> foo = { a : 1, b : 2.2 }
Object { a=1, more...}
>>> foo.a
1
>>> foo.b
2.2
>>> { a : 1, b : 2.2 }
SyntaxError: invalid label { message="invalid label", more...}
>>> { a : 1 }
1
why is the 1 returning for {a : 1} and why is {a : 1,...
Hi all,
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 input element...the javascript object still remains. how can i delete the object dynamically on client side or in short how can one ...