Safari Unable to Load Nested xhmHttpRequest Objects!

I started a project where I used pure CSS and Ajax on the interface, like how Google implemented the Gmail interface. But soon it was clear that Safari’s handling of Ajax and dynamic DOM element updates is very limited.

I created a “div” tag on the base page to load various sections of the website into it using xmlHttpRequest object. Where Safari (and Shiira as well as Opera) failed was when I started loading a separate page into another “div” tag that was dynamically created by the “div” tag created by the base page. At first the problem persisted only within my application. But then I was able to recreate the problem by making a bare application just to load one “div” tag into another.

So basically, Safari is unable to recognize nested HTML elements created by xmlHttpRequest…. Or so my theory goes.

Yuck…

UPDATE 08.02.2006: I tested using a plain javascript to load DOM elements into each other without Safari complaining. So one can assume the issue is only with loading DOM elements via xmlHttpRequest or that the particular method I am using makes Safari very unhappy.

Mom Arrives

My mom arrived last night, just days ahead of Bryan’s birthday on August 1st. We have a feeling she doesn’t want to miss her first grandson’s first birthday!

Last year she arrived just ONE day before Grace gave birth to Bryan… She thought she was really lucky to be able to be in the middle of that wonderful event.

But Bryan was too tired last night on the way home… So he cried during most of the car ride home. But my mom was pretty psyched about seeing him again.

Tomorrow my brother arrives from Los Angeles as well (with his portable A.C.!)…

Let the party begin!

(Now I just gotta finish my Macroeconomics paper, prepare for mid-term exam, finish reading 3 more chapters for my “C programming” class plus related assignments and finish 2 freelance projects ALL before the end of next week… Ah, life of a 31-year-old unemployed foreigner/student-wannabe in America… )

Canada

We finally heard something back from Canadian immigration. The consulate has scheduled an interview with us in October in Los Angeles… That’s a pretty practical and good excuse for us to get out of town for a road trip… But We are not very sure how Bryan will take the long car rides…

I am actually a bit worried about the interview. I already know why they want to interview me… It’s because of my seemingly suspicious expired (and useless) passport. I will have to go into the long story of why it’s expired and how that problem can be fixed. But it’s a catch 22 kind of deal… Canada most likely won’t issue me a Green Card unless I have a valid passport (as stated in the Interview letter); but I can’t get a valid passport unless I have Green Card from another country (long story)! So I am stuck.

The strategy is, as I thought about it, to have the Taipei Economic and Cultural Office (or TECO for short, it’s the closest thing Taiwan has to an embassy in a country with no “formal” diplomatic relations with Taiwan) issue a promissory note to grant me a new passport if Canada can promise to issue me a Green Card… Notice both are just promises on paper — So basically, I get Taiwan to promise a new passport to show the Canadians that I am no criminal so that the Canadians will, in turn, issue a promise to give me Green Card as long as I can obtain a valid passport from Taiwan (based on the assumption that no Green Card can be issued without a valid passport).

But it’s too early to tell what will happen at this stage. Canada might feel it’s too much of a hassle and think that this whole deal is too “fishy” to go through. But then again, I read everywhere that Canada IS short on young talent in various industries… Maybe I will say enough of the right things to make them want me enough to go out of the way just a little bit to help me out…

We are scheduled to go to a “pre-interview” training with the agency we are applying the Canadian Green Card though next week. Hopefully they will reveal some good tips on how to score some cookie points with the Extended Americans… I mean, Canadians.

Bias

I used to think this whole Middle Eastern thing was too complicated to get into and thus tried to stay as neutral on the issues as possible. But the recent crisis between Lebanon and Israel made one thing clear in my mind: The United States is clearly biased towards the militarily superior (thanks to the U.S.) Israel, a Jewish State, than the rest of the region (mostly Arabs). I wish I don’t have to sound so anti-semitic. But it appears that every policy U.S. has had in the Middle East favors Israel!

Not that i have anything against the Israelis, Jews or even the United States in this case. But I thought a Superpower probably shouldn’t play favorites in a sensitive region on sensitive issues (what’s being projected as Arabs v.s. Jews, or Muslims v.s. Christians/Jewish)… Take for example, nuclear weapons: Why is it that Israel can have it but not Iran? To me, Israel looks more like a terrorist state than any of its surrounding neighbors. If Saddam was taken down for suspicion of having Weapons of Mass Destruction, why not North Korea? I mean, it was clear that UN couldn’t find any WMD in Iraq even prior to U.S. invasion. But it’s now obvious that North Korean HAS WMD. So what’s the argument for not taking it down?

Anyway… enough of this stupid rant. It must be the heat getting to me… The apartment is so hot that the thermostat is confused again.

Record High

The past few days in the Silicon Valley have been unbearable. Record high temperatures appear to be everywhere on the map. But of course, that’s no global warming, just the nature… The White House says so.

Bryan has been having trouble sleeping at night because it’s so hot and humid at night. So we have had to mobilize fans in the apartment — one to move cooler air into the apartment when the sun sets and another to cool Bryan off. The strategy is to give him a nice and cool bath before bed time and try to keep him cool with the two fans going… But last night was so exceptionally hot that we had to use THREE fans!

So now Bryan takes 3 cool baths a day to stay cool… Or else nobody gets any rest in the apartment…

Trekkies

Not that I am a Trekky at all…. but an episode on NPR about fan-made Trek series seemed like an interesting idea. And supposedly, even the studios are taking note of a growing movements in fan-made films/TV series (as long as, god forbid, they don’t don’t profit off of them, of course).

I thought Murdza might appreciate something like that… They are supposed to be pretty good quality productions similar to ones on Sci-fi channel. Some scripts are so good that even some of the original Star Trek actors/actresses have guest appeared in some of them!

Coffee

Of all the years I have been in school and at work, I have never had to use coffee or any kind of stimuli to keep me awake, no matter how little I’d slept the night before. Part of the reason was probably I found out rather early in my life that coffee doesn’t really work for me… Or, rather, caffeine doesn’t work for me (Mt. Dew, Coke, tea… etc).

But this week I have had to wake up pretty early everyday for classes. And this middle-aged body isn’t quite as strong as it used to be… So I tried some free coffee at the UC campus to see if it’d do me any good to keep me awake during long Perl lectures… What I found was that… coffee makes my body feel agitated… It just felt weird. I tried it for 3 days and found no good reason to continue.

That was a stupid experiment.

Or maybe that was some cheap coffee that didn’t do sh*t.

Perl and More Perl

Finally finished another intensive 4-day course in more advanced Perl this week. I have to say that Perl gets a little disappointing in the more advanced level. Making an object/class is kind of painful compared to more modern scripting language like PHP. And the CGI portion gets more ugly when it comes to having to edit multiple files in different directories…. or one can venture into using the dreadful CGI package. But luckily there’s Mason which runs on the server side and makes everything very PHP-like. Unfortunately it requires separate installation. And I am doubtful of its support on most web hosting services.

In any case, I am still glad I got to know as much Perl as I did. It’s another tool in my arsenal of scripting/programming languages for future gigs. Next on my list, C, C++, Java, Ruby on Rails, and hopefully someday, Objective-C/Cocoa!

Where Are the Sex Offenders?

While watching the news, the reporter mentioned something about FamilyWatchDog.us as a good resource to see if there are any sex offenders around any neighborhood in the U.S. The result for my neighborhood was a little alarming…

Sex offender map

The red dots are offenders against children, yellow for rape, blue for sexual battery, and green for other offenses. The pattern is also very interesting — It seems like some neighborhoods are possibly more “tolerant” of certain types of sex offenders than others. I did a couple more searches on some friends’ residences, the results were slightly better; but it seems like they are just EVERYWHERE!

The map is supposed to be able to tell you where they work as well as where they live. But I failed to find any dots representing their work address…

When I first moved to California, I also found another map that tells you where all the latest crimes are happening in your neighborhood. Internet is truly a great resource for things… I wish the government could spend more money on solving domestic issues instead of spending billions a month in the name of solving someone else’s problems. But hey, what do I know. I am not even American! 🙁