Welcome

Welcome to CMS n Web. Learn & Study completely Free Articles\Training about Web Designing\Development and CMS.

Search This Web

Monday, March 10, 2014

JavaScript quiz from Perfection Kills

I came across this JavaScript quiz on a very cool blog and since I really enjoy solving such problems, I took the quiz. The result was humbling, and I was eager to find out why I got some of the questions wrong. I figured out why each problem behaves the way it does so I put them together for others below.

1
2
3
1. (function(){
      return typeof arguments;
    })();
(a) “object” (b) “array” (c) “arguments” (d) “undefined”
The answer is (a). The arguments array is of type “object”. My first instinct was to think its an array, until I realized there was a typeof to be considered.
1
2
2. var f = function g(){ return 23; };
    typeof g();
(a) “number” (b) “undefined” (c) “function” (d) Error
This results in an error because the function g has been assigned to the var f. So the answer is (d)
1
2
3
4
3. (function(x){
      delete x;
      return x;
    })(1);
(a) 1 (b) null (c) undefined (d) Error
I made the mistake of assuming I could delete x, but apparently you cannot delete arguments inside a function. So the answer is 1 which is option (a).
1
2
4. var y = 1, x = y = typeof x;
    x;
(a) 1 (b) “number” (c) undefined (d) “undefined”
The answer here is “number”, because after assigning a value of 1 to y, x is also assigned that value. Doing a typeof on 1 obviously yields “number”.
1
2
3
5. (function f(f){
      return typeof f();
    })(function(){ return 1; });
(a) “number” (b) “undefined” (c) “function” (d) Error
Notice that we pass a function which returns 1 to the function f, which inturn executes the passed function and evaluates the type of the returned value. So typeof 1 results in “number” which is option (a)
1
2
3
4
5
6
7
6. var foo = {
     bar: function() { return this.baz; },
     baz: 1
   };
   (function(){
     return typeof arguments[0]();
   })(foo.bar);
(a) “undefined” (b) “object” (c) “number” (d) “function”
This returns “undefined” because when the foo.bar function is executed, “this” refers to the window scope which ofcourse knows nothing about baz. How do you fix this?
Remember how to use JavaScript’s call() and apply()? If not, check here
In this case, we need to specify the “this” to be the object “foo”, like this:
1
2
3
4
5
6
7
var foo = {    
     bar: function() { return this.baz; },
     baz: 1
   };
   (function(){
     return typeof arguments[0].call(foo);
   })(foo.bar);
1
2
3
4
5
7.  var foo = {
      bar: function(){ return this.baz; },
      baz: 1
    }
    typeof (f = foo.bar)();

Thursday, February 27, 2014

38 jQuery And CSS Drop Down Multi Level Menu Solutions

Hello again, it’s time for the comprehensive programming article. Here you’ll find 38 mainly jQuery and CSS-based drop-down or just multi level menu tutorials with downloadable files and explanations as well. My favorite here is the first pick – Outside the box with a very unique navigation menu. It’s always good to have such reference articles in your bookmarks and when you have to create some really big website with a lot of content and menu sections – just return here. Shorten your developing process with already premade menus, which can be easily modified with a little touch of CSS.

the-c-tree.blogspot.com 
check out fine C# articles


But well, also be aware when each code has been created, has it got some updates through time? In our development niche standards, technologies change so quickly that sometimes when you decide to use specific menu, it’s very hard to implement it and at the end, you’ll even may need to rewrite the code just because of incompatibility. So be cautious!
Here you’ll find mainly free solutions, but I would also suggest for some special occasions, quick projects to consider some of design/code marketplaces, where you can buy optimized,documented and update codes for really cheap prizes. I can assure the quality is high,otherwise marketplaces won’t get so popular…and my experiences are only positive and I really am ready to spend 5-10 for important code snippet, saving probably hours of my time. I myself have tried CodeCanyon and Mojo-Themes marketplaces, I am sure there are many more out there, but these two are definitely the ones I recommend.
At least I am doing my designing process like this -
  • 1st- I do simple browsing to find if there are appropriate codes, snippets,tools available for free (like this article for example).
  • 2nd- If after like a 5-min browsing I cannot find anything what suits to me, here is time for those marketplaces where usually I always find something good, and I can move forward.
What’s your experiences?
And why you are figuring answers – enjoy this quality article!

1. “Outside the Box” Navigation with jQuery

This tutorial will cover a few ways to do just that with OS X style docks and stacks navigation.
outside-box-drop-down-multi-level-menu-navigation

2. Sexy Drop Down Menu w/ jQuery & CSS

In this tutorial, you will learn how to create a sexy drop down menu that can also degrade gracefully.

sexy-jquery-drop-down-multi-level-menu-navigation