« Return to Thread: Question on : syntax
Re: Question on : syntax
correction to my dotnet cod
namespace mynamespace {
public class myclass{
void hideElemen(string elementName)t {
elementName.visibility = false;
}
}
}
}
namespace mynamespace {
public class myclass{
void hideElemen(string elementName)t {
elementName.visibility = false;
}
}
}
}
On Thu, Jul 2, 2009 at 8:21 PM, waseem sabjee <waseemsabjee@...> wrote:
it is similar do dotnet yes
JS
==========
var mynamespace = function() {
return {
hide : function(o) {o.style.display = 'none'
var obj = document.getElementById(o);
}
}
}();
dot net C#
==========
namespace mynamespace {
void hideElemen(string elementName)t {
elementName.visibility = false;
}
}On Thu, Jul 2, 2009 at 8:15 PM, expresso <dschinkel@...> wrote:
what is meant by a namespace. I view namespace as like in .NET
classes, is this the same concept?
On Jul 2, 1:10 pm, expresso <dschin...@...> wrote:
> Thanks a lot. The second response really helped me as I'm not so
> versed in hard core JavaScript. Obviously not being that well versed
> in it is hindering my ability to understand plug-in code, ability to
> distinguish between standard JavaScript notation/features vs. jQuery
> in the same file, and ability to understand jQuery a bit also.
>
> migrane every day until I get this stuff down, not as simply as
> everyone says. Yea jQuery is simple once you are a master at
> JavaScript and master of the jQuery language! I love that claim.
>
> On Jul 2, 1:00 pm, waseem sabjee <waseemsab...@...> wrote:
>
> > lets go back to basic JavaScript.
> > take this example
>
> > var display = function() { // create namespace display
>
> > return {
>
> > hide : function(o) { // add function hide to namepsace
> > var obj = document.getElementById(o);
> > if(obj.style.display != 'none') {
> > obj.style.display = 'none'
>
> > }
> > },
>
> > show : function(o) { // add function show to namespace
> > var obj = document.getElementById(o);
> > if(obj.style.display = 'none') {
> > obj.style.display = 'block'
>
> > }
> > }
> > };
> > }();
>
> > function init() {
> > display.hide("mydiv");
> > setTimeout("display.show('mydiv'), 1000);}
>
> > window.onload = init;
>
> > it is a more object orientated way of scripting
>
> > as you can see i created my own namespace called display
> > then i assigned two function to it
> > display.hide
> > and
> > display.show
>
> > so you can say your are creating your own namespae with it's own set of
> > functions.
> > the cool thing is if i create a namespace that controls sideshow behavior i
> > can reuse my display namespace for the hide show transitions.
>
> > On Thu, Jul 2, 2009 at 7:08 PM, expresso <dschin...@...> wrote:
>
> > > I have yet another syntax question.
>
> > > I know that : can be used for specifying things like filters, but what
> > > does it do in this case:
>
> > > $jc.fn.extend({
>
> > > setup: function() {
> > > this.first = null;
> > > this.last = null;
> > > this.prevFirst = null;
> > > this.prevLast = null;
> > > this.animating = false;
> > > this.timer = null;
> > > this.tail = null;
> > > this.inTail = false;
>
> > > if (this.locked)
> > > return;
>
> > > this.list.css(this.lt, this.pos(this.options.offset) +
> > > 'px');
> > > ...rest of code here
> > > },
>
> > > so what is the syntax setup: an attribute?
« Return to Thread: Question on : syntax
| Free embeddable forum powered by Nabble | Forum Help |