The Auldridges

Blessed Beyond Reason

JavaScript Cookie Library

Filed under: Technology — by Jim on November 2, 2005 @ 12:39 pm

Technorati Tags : , , ,

Close on the heels of my Generic AJAX Library I have written a cookie handling library.

For those not aware, a cookie is a small bit of data that a developer can leave on your PC to ‘rememember’ things. This technology was enabled because of the stateless nature of HTTP–the protocol that web pages are transmitted in. It allows programmers to leave information, such as your login preferences, on your computer to remember what your preferences were next time you come back to the site.

Most all web development languages and environments have methods of accessing and manipulating these bits of data, but JavaScript’s is very limited. You can read from and write to the document.cookie string, but all of the actual data formatting or interpreting is left to you to do manually.

This being the case, I have been wanting to write an OOP based version of a library that provides this functionalty to programmers in the JavaScript environment. Others have done the same in the past, and I am not claiming mine is much better. But I didn’t find everything that I was personally looking for in the ones I saw out there, and I love writing things myself. My friend Dustin has mentioned it before, and I agree with him–sometimes it’s better, even more fun, to re-invent the wheel. It also doesn’t hurt to get more examples of such code out there to help others who are Googling about hopelessly needing something like this. ;)

So, I’ll leave you to my demonstration page for the Cookie Library, better known as cookieLib. Enjoy!

Powered By Qumana

--Jim


Our Little Visitor

Filed under: Daily Life — by Jim on October 30, 2005 @ 2:22 pm

As mentioned in the last post, we had a little visitor the other night.

 

For around a year now, Shari has been involved in the Youth For Christ young mothers mentoring program. She has had the opportunity to mentor a young girl who was, when they met, pregant and has now had the baby. The baby’s name is Haley and she is 4 months old now. Here’s a picture:

Haley Bug

 

Unfortunately, Haley has been under the weather for a few weeks, and has not been sleeping well. This left her mother very tired and worn out. So she called and asked if we’d keep her overnight so she could get a solid night of sleep to re-energize. As is now obvious, we obliged.

 

And she did very well with us. There was some crying, mostly from being tired and missing her mom. But we got her settled and she slept the whole night for us. A surprise to her mom, of course. But you know how kids are–they always push mom and dad harder than anyone else.

 

Anyway, we had a good time with her. We don’t often have a little girl around here, especially at that age. It was a good reminder for me, though, as to why we requested a 2-4 year old in our adoption process. I will, of course, be willing to take whatever age we can get, but I wouldn’t mind skipping some of the infant stuff! ;)

Powered By Qumana

--Jim

Pun’kin Carvin’

Filed under: Daily Life — by Jim on October 29, 2005 @ 7:49 pm

Even though our neighborhood is odd and refuses to do Trick-Or-Treating on the actual date of Halloween, and thus we completed that activity 2 days ago, we carved our Jack O’Lantern tonight. I should have had that done a few days back, I suppose, but these things sneak up on me. Regardless, it is still in time for the actual Halloween day, and looks good. There’s pictures if you care–and I know that you do. ;)

After the carving, Shari roasted the seeds of the pumpkin for the kids to eat. They gobbled them up, and then Shari broke the bad news to them–they can’t drink water for several days because the seeds will sprout and grow pumpkins in their bellies! They weren’t sure they believed that until Shari called Papa (her dad) and let him explain that it was, indeed, the case. :)

Tonight is also the night that clocks will turn back. While this is the better half of this bi-annual occurence because we gain an hour, it is also somewhat difficult because it means the kids will probably be up even earlier tomorow since their little internal clocks haven’t reset. This being the case, we are keeping them up an hour later than usual tonight. To help Shari and I with the mental issues this can bring about, we’ve opted to go ahead and change the clocks in our house. That way we aren’t looking at the clock and thinking, “golly it’s getting late, we really need to get them to bed!”

Speaking of which, we’re nearing that time now so I suppose I’ll get off here for now and help out with that routine. I’ll post more later and tell about the small visitor we had overnight last night–how’s that for a cliff hanger!?

Powered By Qumana

--Jim

Generic AJAX Library

Filed under: Technology — by Jim on October 25, 2005 @ 2:23 pm

Technorati Tags : , ,

[bad irish accent–for some reason] Ah was gonna keep this to meself and see where it took me, but Ah just get too excited and have to share with ye lads. ;) [/bad irish accent]

Ever since a discussion at Christian Web Masters on Apr 5 2005, I have been trying to write what I consider a really genericized (is that a word?) version of an AJAX library.

One thing I always hated about AJAX is that, due to the use of the onreadystatechange event handler, things often needed to be hardcoded to the methods involved, making code re-use very difficult when using AJAX in more than one spot within any particular page.

I think I have now done it, though. I have an object whose methods I can call to get XML documents and pass the data for handling. I create external functions for data handling and error handling, and simply pass their names, along with arguments, and the URL to the XML to the AJAX object.

If, later down the same page, I have another document I want and need to do different things with it, I simply call the method with different URL and data-handling function names.

As you can see at my test page, I have a page that calls the AJAX library file, defines 2 functions for handling the returned data–one for error and one for success–and a function that initiates the whole thing when you click the link. The latter of the functions is told what URL to use in getting the file, what method to evok on success, what arguments to pass to the success function, and what function to invoke on failure.

When you click the link, you should see an alert. The first lin of the alert should tell you the sum of the srguments passed to it–to show that the arguments are working–and the rest of the alert shows the responseText of the XMLHttpRequest to show that it’s working as well.

Hope you (web) guys find this helpful, I know I do!

Powered By Qumana

--Jim

More on Housing

Filed under: Daily Life — by Jim on October 24, 2005 @ 3:01 pm

To catch you up, we did go and see the house I mentioned a few days back, and then we saw another a couple days later.

I had already told you how I thought the first one was over priced, and now that I see it I know it is. I will correct myself, though–I said it was 3BR and it is currently 4 with the possibility of being 5. I also said it was 2.5BA, but it is only 2. Regardless, it has not been touched cosmetically since the early 70’s. Nor have the appliances or mechanics been updated. So I would estimate it needs 20-30k worth of work. We are considering making a very low offer that would allow us to do to this house what it needs.

The second house isn’t really worth mentioning, except that it was built in 1820 and the listing was written in a manner that made me feel like I had to at least give it a look. But it has issues of both needing updating, and not appearing to be real structurally sound.

Other than the possibility of low-balling an offer on the first house, the market doesn’t look real agreeable to us. So I believe it is probably time to go ahead and start getting estimates on a remodel/addition to our current home. We can at least see what some companies think it will take, and begin planning for it if we so choose. As I stead on the issue before, though, I don’t know how realistic it is to do the remodel and fix things I want fixed.

I guess the only way to come to a decision is continue looking at and analyzing each option, and to pray.

Powered By Qumana

--Jim

Testing Qumana

Filed under: Technology — by Jim on October 21, 2005 @ 2:39 pm

As I get into the real, low-down blogging scene I find more and more things to learn. Blogging, as many of you know, is such a hot thing on the Internet that a whole new set of technologies is rising up around it. From services like Technorati to this new application I am using (Qumana) for remote blog management, there is a giant new field of learning ahead of me. It never seems to end–which is cool because if it did end I’d be bored. ;)

Powered By Qumana

--Jim

My Boys

Filed under: The Kids — by Jim on October 18, 2005 @ 3:25 pm

I wanted to get an entry into the topic entitled ‘The Kids’, and I figured what better way than to put up their pictures and brag on them :)

gabriel snapshot1 christian snapshot1 caleb snapshot1

As you can see, they are the finest looking boys one has ever seen. They are really quite good looking, and I say that objectivley and not as a proud dad. :) And each of them is extremely smart. Gabriel is in the advanced classes in his school and in the enrichment program for advanced students. Christian is one of those people that grasps a concept and can then use it to do anything to which the concept is applicable. And Caleb is always “putting 2 and 2 together” in developing an understanding of the things that go on around him. The three of them always amaze me–probably because I am a little slower than them. ;) While they like to push Shari and me now and then with their behaviour, they are very well behaved children. They respect us and obey, generally. And I have come to realize that while I may see them disobey here and there, that it is their job to test their limits against Shari and me, their parents. That’s what kids do–that’s how they learn right and wrong and their place in society. It’s away from the parent that the child’s real attitudes and behaviours reflect. A child who is respectful of the rules, the adults around them, and their peers–even when Mom and Dad aren’t around–is a child who is well behaved. And my boys do just that. That isn’t necessarily a reflection of good parenting on Shari’s or my (especially me) part. We screw up a lot. We just have good boys. I guess I’ll wrap this mush-fest up by saying that I love them each more than they can know right now, and am proud of them and thankful for them.

--Jim

Housing, and What To do

Filed under: Daily Life — by Jim on October 18, 2005 @ 3:05 pm

This evening we will be going to look at a house for sale in the neighborhood we live in. With the adoption pending, we realize the need to either put an addition on our house, or purchase a larger one. Or one with the potoential to become larger with much less hassle than our current home.

We have a fair amount of equity in the house we are now in given that we have had it for 2 years now, and the market here grows at a break-neck pace. This would allow us to put an addition on the house, but we don’t know if we want to go through the hassle of adding what we need. Our plans would have us adding a bedroom and a bathroom, and remodeling the kitchen and two existing bathrooms. The kitchen isn’t in any real need of remodeling, but it sits right where the addition would have to go, so it gets included. On top of those things, though, the house is 56 years old and in need of many other things. For instance, the furnace needs work/replacement, the side porch is rotting, and the brick needs re-pointing. All of this will take quite a lot of money, and remodels are supposed to be one of the most stressful things you can go through–especially if you are living in the house, which we are.

So, we then look to the option of moving. We love our current neighborhood (more…)

--Jim

To Elaborate…

Filed under: Daily Life — by Jim on October 15, 2005 @ 4:59 pm

Well, it’s been a busy week since we returned, but I’ll try to fill you in on the trip and the rest of the week.

As I mentioned in the last post, I couldn’t find any wireless signals from which to leech, so I couldn’t get any Internet while at the beach. That was fine considering I was at the beach and had lots to do. But I missed being able to post to the blog, and keeping the checkbook up to date with online banking.

The beach was great. Shari and I were in a beach house that my uncle Steve had rented along with his wife-to-be, Linda, my cousin Liz and her boyfriend Steve, my ‘aunt’ Kathy and her husband bill, and Linda’s son Michael. My parents were just down the street with my brother Ike, his wife Angie, my sister Hilary, her husband Sean, their kids Shannon and Ethan, my grandfather Tom and his friend Juanita, and my Uncle Jimmy and Jill. We had a very good time seeing everyone and just being right on the beach.

The wedding itself, our reason for being there, was on Sunday afternoon. It was awesome. They had it right on the beach (more…)

--Jim

Checking In…

Filed under: Daily Life — by Jim on October 10, 2005 @ 9:27 pm

Just a note to say that I couldn’t get access to the Internet at the beach, but that we are now home. Will write more about the events of this weekend later…for now, must rest. ;)

--Jim