29. June 2009 15:39
Okay, so you have a bunch of script references, some added via your master template, others in your views. You'd also like to be able to handle script adds in your partial views. The problem is, you don't want your views, and partial views to know about the implementation details. What I am going to do, is outline my solution for adding needed scripts into a given view/output without having duplicate script tags, and allowing each master, view, and partial to call for all the scripts it will need. More...
13. May 2009 02:34
Okay, I love Javascript. It is hands down my favorite language (C# is a near second). In fact, it was the first language I ever learned, even before having a good handle on html markup in the mid-90s. I used it server-side with Livewire on Netscape server. I transitioned to (now Cassic) ASP, and picked up vbscript (COM enumerations via JScript were so evil). When .Net first came out, i hacked my way through using the JScript .net command-line compiler, and early ASP.Net (ASP+), after translating a litteral ton of code from VB.Net and C# samples, I caved and learned C#. Allong the way, I picked up on several SQL Dialects, VB6, some perl and others; but I always get back to Javascript. More...
11. November 2008 22:14
My goal is to create a personal website application that implements the features needed, and wanted for someone who wants to create a personal site that extends beyond just a blogging engine. I've been wanting to work with ASP.Net MVC and some other technologies, so I'll be focusing on using them in MySite. More...
1. October 2008 14:59
Today I had to create a FAQ page. In order to make this work nicely I started with a simple Dictionary List markup, and some jQuery sugar to make an expand/collapse list. Although I love prototype.js, jQuery's nesting and inline DOM object creation really comes in handy. More...
12. September 2008 08:55
Okay, this snuck by me a couple weeks ago, but the Silverlight Dynamic Languages SDK 0.3.0 was pushed out on August 30th, 2008. Although the main focus of this SDK is for use in Silverlight, the DLR included in this SDK can be used to generate a nice, multi-language scripting environment for your own applications.
11. September 2008 18:07
Okay, I was playing around with the DOM Ready vs Window Load events with prototype.js and noticed that in my simple example, the window event actually fired before the dom event in IE8. This could lead to some issues, especially on cached pages, so I wanted to make a note of it. Why is it even an issue? Well, using the DOM ready event will allow you to hide things as soon as the tree has it. Using the window loaded event is necessary in order to handle flowing layouts in terms of size/proportion. More...
11. September 2008 17:13
Okay, I was playing around with the DOM Ready vs Window Load events with prototype.js and noticed that in my simple example, the window event actually fired before the dom event in IE8. This could lead to some issues, especially on cached pages, so I wanted to make a note of it.
1 var ready = { document: false, window: false };
2 function DocumentReady() {
3 alert("Document Ready");
4 }
5 function DocumentLoaded() {
6 alert("Document Loaded");
7 }
8 document.observe("dom:loaded", function() {
9 DocumentReady();
10 ready.document = true;
11 if (ready.window)
12 DocumentLoaded();
13 });
14 Event.observe(window, "load", function() {
15 ready.window = true;
16 if (!ready.document) return;
17 DocumentLoaded();
18 });
The previous example shows how to handle this case. Why is it even an issue? Well, using the DOM ready event will allow you to hide things as soon as the tree has it. Using the window loaded event is necessary in order to handle flowing layouts in terms of size/proportion.
27. August 2008 12:33
Okay, so you want to trim a string in JavaScript/JScript/EcmaScript, but you find that the functionality just isn't built in. Here's a quick little snippet that will add said functionality pretty easily. More...