March 30, 2007 at 12:02 pm
by Wolfram · Filed under Dojo, JavaScript, Programming
Dojo’s class construction kit is a nice thing, once you know how to use it. What I especially like about it, is that it even allows for multiple inheritance!
Just a short example, I have a base class for a page (as you used here). If the page also contains forms then I also use the “myproject.form” class, that I can simply add to my page’s class via multiple inheritance, that is so neat! Like so:
dojo.declare("myproject.page.ideas", [myproject.page, myproject.form],
function() {}, {
});
Happy inheriting …
Permalink
March 30, 2007 at 11:59 am
by Wolfram · Filed under AJAX (style) guide, Dojo, JavaScript, Programming
There are situations when you are hunting a bug and you got the feeling that it actually is no real bug, it’s just a typo or something as simple, but you just can’t find it. So I better write that down so next time I am searching for this error message I will get the result right away. Those are the kind of errors that are just nasty but time consuming. Actually it’s a PTS bug, Programmer too stupid bug.
I have written a little class for my current page, nothing fancy and not really any substantial code in there. But somehow I still get this nasty error, that Firebug (btw a must have tool) shows as you can see in the image.
dojo.declare("myproject.page.ideas", myproject.page,
function(pageData) {
// initialize the class here right on it's instanciation
}, {
onPageLoaded:function() {
// Is being called by the parent class, when dojo.addOnLoad() hits.
}
});
var page = myproject.page.ideas({});
At some point you are getting blind looking at you code, and so it was here. The problem is very simple. I forgot the “new” before the class instantiation (let’s not discuss if it is a class, object, type, …).
var page = new myproject.page.ideas({});
Permalink
March 30, 2007 at 10:42 am
by Wolfram · Filed under AJAX (style) guide, Programming
Just so I know where to look up this rare problem. Because I know I will stumble over it again and search the web again though I had found the solution already once before, just don’t remember where
/* This is ONLY for IE, since the following rule wont work without this one here.
The IE requires just something here in the "a:hover" before it works with a child selector behind it. */
#regionContainer a:hover{
text-indent:0;
}
#regionContainer a:hover span {
display:inline;
}
Thanks to this guy’s post.
Permalink