How can i call test() inside that method? It's possible?
(function() {
tinymce.create('tinymce.plugins.WrImagerPlugin', {
init : function(editor, url) {
editor.addCommand('mceWrImagerLink', function() {
//--> how can i refer to test() here?
});
},
test: function () ...
In c++, during a class constructor, I started a new thread with 'this' pointer as a parameter which will be used in the thread extensively (say, calling member functions). Is that a bad thing to do? Why and what are the consequences?
Edit: my thread start process is at the end of the constructor.
Thanks,
Gil.
...
I know c# well, but it is something strange for me.
In some old program, I have seen this code:
public MyType this[string name]
{
......some code that finally return instance of MyType
}
How it is called? What is the use of this?
...
hello there, i have been given class with int variables x and y in private, and an operator overload function,
class Bag{
private:
int x;
int y;
public:
Bag();
~Bag();
//.......
//.....etc
};
Bag operator+ (Bag new) const{
Bag result(*this); //what does this mean?
result.x += new.x;
resul...
Hey everybody -
This is my first time here so I hope I don't come off too stupid!
I have a very simple jQuery problem: I have a database-generated ul-based navigation and I want list items that contain other lists to toggle showing those contained lists. The (generated) lists look like this (Wordpress code; ignore the Japanese):
<div ...
What does 'this' keyword refer to when used in gloabl object?
Let's say for instance we have:
var SomeGlobalObject =
{
rendered: true,
show: function()
{
/*
I should use 'SomeGlobalObject.rendered' below, otherwise it
won't work when called from event scope.
But it works when called f...
hi,
i got the following code
var zieldiv = $(this).attr('id');
$.ajax({
url: 'index.php?params',
type: 'POST',
data: { color:thenewcolor, zieldiv:zieldiv },
timeout: 50000,
beforeSend: function() {
$("#" + zieldiv).css({background: "#" + thenewcolor} );
}
});
I use this for ...
in java we can do this:
public class A{
public static void main(String...str){
B b = new B();
b.doSomething(this); //How I do this in c++ ? the this self reference
}
}
public class B{
public void doSomething(A a){
//Importat stuff happen here
}
}
How can I do the same but in c++, I mean t...
I'm having trouble referencing the desired object when I've namespaced functions.
No problems here:
obj.test = function() {
// this == obj
}
But I'm getting tripped up when I namespace:
obj.namespace.test = function() {
// this == namespace
}
In the latter example, I know this references namespace, but I want to reference obj....
Is there a workaround for Internet Explorer to implement the functionality offered by 'this' javascript keyword to get the dom element that triggered the event?
My problem scenario is :
I have a variable number of text fields in the html form, like
<input type="text" id="11"/>
<input type="text" id="12"/>
..
I need to handle the...
Hi,
I have the following member of class foo.
foo &foo::bar()
{
return this;
}
But I am getting compiler errors. What stupid thing am I doing wrong?
Compiler error (gcc): error: invalid initialization of non-const reference of type 'foo&' from a temporary of type 'foo* const'
...
$ javac TestFilter.java
TestFilter.java:19: non-static variable this cannot be referenced from a static context
for(File f : file.listFiles(this.filterFiles)){
^
1 error
$ sed -i 's@this@TestFilter@g' TestFilter.java
$ javac TestFilter.java
$ java TestFilter
file1
file2
file3
TestFilter.ja...
This is not a question about jQuery, but about how jQuery implements such a behaviour.
In jQuery you can do this:
$('#some_link_id').click(function()
{
alert(this.tagName); //displays 'A'
})
could someone explain in general terms (no need you to write code) how do they obtain to pass the event's caller html elments (a link in thi...
I have a GUI architecture wherein elements fire events like so:
guiManager->fireEvent(BUTTON_CLICKED, this);
Every single event fired passes 'this' as the caller of the event. There is never a time I dont want to pass 'this', and further, no pointer except for 'this' should ever be passed.
This brings me to a problem: How can I asse...
OK, going rond in circles again - I'm sure the answer will be obvious. Just not to me :)
I can't seem to specify this as one target amongst a few targets for a function:
$(this, "elem1, elem2").doStuff()
I just want to doStuff() to a pair of elements, one of which is this. I can only get it to work if I explicitly name the elements, ...
Hello again, just another quick one:
I am noticing differences with fadeOut dependant on whether this is a target. Here's my structure.
I have rows of data on my page, and each row has two icons. One is an update icon for that row, one is a delete icon for that row. When a user clicks the update icon for a particular row, I want both t...
Can I do the following?
public Manager(String userName) {
game = new Game(userName);
game.addManager(this);
}
The problem is that I refer to an object (this) in its constructor (before it was actually created).
...
Hi,
I'm trying to write a simple wrapper for mouse behaviour. This is my current code:
function MouseWrapper() {
this.mouseDown = 0;
this.OnMouseDownEvent = null;
this.OnMouseUpEvent = null;
document.body.onmousedown = this.OnMouseDown;
document.body.onmouseup = this.OnMouseUp;
}
MouseWrapper.prototype.Subscribe = funct...
While coding JavaScript sometimes you store the reference of object this in a local variable for different purposes (to set proper scope, to help code obfuscators, etc.). There are coders who prefer aliasing this to that to make it obvious its intention. Other guys use self since it's pointing to the object itself. I even saw source code...
Hi,
I have the following code. I expected to see "archive" object on my firebug console, but I see Window object. Is it normal?
var archive = function(){}
archive.prototype.action = {
test: function(callback){
callback();
},
test2: function(){
console.log(this);
}
}
var oArchive = new archive();
oArchi...