Webistrate - Draw Your Own Conclusions

jQuery: Creating Your Own Selector

Posted by Jamie Munro | January 16, 2012 | Tags:

By default, the jQuery selectors are pretty advanced.  You can select items by classes, ids, attributes, the first, the last, etc…  But why stop there?  By simply extending jQuery, we can add our own custom selectors to further enhance how we use jQuery.

See the solution »

Share


MVC 3: Compile Views During Project Build

Posted by Jamie Munro | January 9, 2012 | Tags:

Most ASP.NET developers will use Visual Studio to build their projects. The program has evolved quite a bit over the past few years.  Including excellent features like Intellisense inside of ASP.NET MVC view files as well as some error detection in these, by default, not compiled elements.  However, when ViewBag variables are used or other run-time specific elements, Visual Studio is unable to determine potential errors in these view files.  Have no fear though; there is a nice and simple solution to help solve this problem!

See the solution »

Share


jQuery: Checking if an element exists

Posted by Jamie Munro | January 2, 2012 | Tags:

You want to do some conditional processing depending on if an item or items exist in your DOM (Document Object Model).

See the solution »

Share


HTML: Absolute Position…when it’s relative

Posted by Jamie Munro | December 26, 2011 | Tags: ,

I have long been against absolute position.  I always felt it the “lazy” way out.  Until recently!  I’ve finally seen the light!  Absolute positioning works extremely well inside of a relative position.  In fact it works so well, that it reduces my browser testing time because IT IS actually consistent!

See the solution »

Share


jQuery: Implementing a callback

Posted by Jamie Munro | December 19, 2011 | Tags:

As we move into a more and more interactive era of website development, more of the JavaScript work is being done asynchronously and not “top-down”.  This can provide some interesting challenges, for example, executing a specific action after a specific process has been completed – also known as a callback.  Thankfully, jQuery provides some useful functions to help with this process.

See the solution »

Share


jQuery: Global AJAX Events for Start, Stop, Complete, or Error

Posted by Jamie Munro | December 12, 2011 | Tags:

Your website contains a lot of AJAX requests using jQuery and you want to add a global event at the start or finish of the AJAX request, e.g. add a spinning icon, or handle all AJAX errors in a particular fashion.

See the solution »

Share


MVC 3: Accessing the RouteData inside of your code

Posted by Jamie Munro | December 5, 2011 | Tags:

You want to perform some dynamic processing in your code and you need to determine either the name of the current controller or the current action or both.

See the solution »

Share


MVC 3: Posting form variables that are not strongly typed

Posted by Jamie Munro | November 28, 2011 | Tags:

In a lot of the MVC 3 examples that are available on the Internet today, they are quite typically strongly typed to a model, e.g.

[HttpPost]
public ActionResult LogOn(LogOnModel model, string returnUrl)
{
if (ModelState.IsValid)
{
// code here
}
}

This is extremely useful for the validation abilities and many other aspects; however, there are times when some or all of the data is not strongly typed; then what do you do?

See the solution »

Share


jQuery: Splitting an unordered list into multiple columns

Posted by Jamie Munro | November 21, 2011 | Tags:

I was recently answering some questions on Stackoverflow and an intriguing question came up.  How do I split an unordered list into a multiple lists to turn them into columns?

E.g.

  • Test 1
  • Test 2
  • Test 3

Becomes:

  • Test 1
  •  Test 2
  •  Test 3

One of the keys of course is speed and not duplicating/cloning the DOM elements because it will be extremely inefficient.

See the solution »

Share


jQuery: Manipulating an array of HTML elements with $.map()

Posted by Jamie Munro | November 14, 2011 | Tags:

jQuery’s $.map() function is a pretty neat function.  It accepts an array as a parameter and then will iterate through each item in the array allowing you to further manipulate and build a new array with that data.  This article will explore how to use it while providing a useful example.

See the solution »

Share


Page 2 of 41234

Buy one of my books