Category Archives: Uncategorized

Firefox Addin that saved my ass – Poster

Without going into too much detail I am working on an application where a small portion of the functionality allows companies to assign and track online training for their employees. We aren’t in the business of creating or hosting the online classes but we need to be able to track their progress through each course so we can give them credit when they complete it.  The online class provider uses the HACP interface (I would love to add a link to resources if you are looking for them but they are hard to come across) which means that it POST’s data to a page you provide, you work your magic and send a response back. I did this and it worked perfectly… when we hosted the content.

When we made out way out to production and a client went to use it they noticed that the course launched just fine but when they completed the course nothing happened. I looked in the database and sure enough nothing had been updated. Since we use ASP.NET my initial response was to make sure the page was allowed to be acccessed without being authenticated and that was correct. I knew the provider was able to hit the page since when the course is launched the it hits the page and gets a response with the users information so it had to be something else.

The main problem I ran into was that I couldn’t attach to the process in production to debug and I couldn’t replicate the real world scenario so I had no clue how I was going to attack this problem.

Tonight I got an email from CodeProject that had a link to an article called 15 Firefox add-ons for Web developers. I like tools so I checked it out. Low and behold there is an addin that allows you create your own web request (GET, POST, HEAD, etc…) and change it to be what you want. This addin is called Poster (boring name but effective). I installed it and within a few minutes I was able to mimic the exact scenario that I needed to. The problem that I ran into was that ASP.NET validates requests and it was blocking the content saying that it was unsafe. I added ValidateRequest=”false” to my header and it works now.

If you are looking for information about HACP and C#, VB.NET, ASP.NET or any combo in between there aren’t many resources and I’m not sure what I am allowed to share so RTFM over and over again. Good luck!

jQuery Check All Checkboxes by Section

Recently I needed to allow users to check all checkboxes in a given section or the entire page. This is really easy to do with jQuery so let’s get to the sample:


Check All on this page

Check All in this group
Group 1 Check 1
Group 1 Check 2
Group 1 Check 3
Group 1 Check 4
Check All in this group
Group 2 Check 1
Group 2 Check 2
Group 2 Check 3
Group 2 Check 4

Here are the basics of the code:

jQuery Check All Checkboxes

The implementation can be done inline (as I did) or by creating an event handler via $(Document).ready();

The key points with the code is how the selectors grab the correct checkboxes to check/uncheck. The top checkbox grabs all of the checkboxes on the page and the inner checkbox grabs all of the checkboxes that are contained within the specified table. Once the checkboxes have been found their status is set to the status of the checkbox being used (all or section only).

Dear Internet Explorer…

I’ve cheated on you. Many times. And I loved it.

For many years I have been one of your strongest supporters and proponents even when I knew little about my other options. I love most things Microsoft but you make it nearly impossible for me to love you anymore.

I zig, you zag.
I bob, you weave.

While I do believe in monogamy I think you should allow me to bring in others that will help me which in turn helps you.

Help me help you.

The things that I need do not seem to be that far fetched as your competition has them or at least allows others to fill the gap.  When I want to see all of the included JavaScript and CSS files I can you JSView. When I want to do ANYTHING with JavaScript, CSS, or the DOM I can use Firebug. When I don’t want my browser to crash or hog my system I can run any other browser.

I find that the only time I need you is for corporate purposes and testing for ill-informed users. I am sad to say this but I think we need to take a break and for once it’s you; not me.

Sincerely,
Luke