zoloft pills

Blog Archives

Javascript shorthand for string comparison

Do you write this kind of code? (string1 == “test” or string1 == “staging” or string1 == “dev” or string1 == “internal” or string1 == “beta”) Think twice!

Attaching events to disabled input elements

I encountered an issue that all the attached mouseover and mouseevent events on a disabled checkbox <input type=”checkbox” disabled=”disabled”/> failed to work. After verifying the issue from a few references, I confirmed that this is an expected behavior of a disabled form element (button, input, optgroup, option, select or textarea). Many argued that if a form element is disabled, it should not trigger any event. However, for various reasons, I just need it to trigger certain events. For example, I may want a tooltip to appear when you hover on a disabled field to explain why the field is disabled. This requires [ ... ]

HTML 5 – Drag and Drop Download in Chrome

Drag and Drop (DnD) is one of the many great features of HTML 5, and it is supported in Firefox 3.5, Safari, Chrome and IE. Google recently rolled out a new feature that allows Google Chrome users to drag and drop files from the browser to the desktop. It is an extremely convenient feature, but it was not widely known until Ryan Seddon posted an article on the discoveries of his reverse engineering on this new feature. At Box.net, we are very excited about how these new capabilities are enabling us to improve our cloud content management solution, as [ ... ]

innerHTML, innerText and textContent

innerHTML, innerText, textContent, html() and text()? Assuming we have a div block that contains two lines of text and a hyperlink. We want to enable inline editing so that we only edit the text and not HTML. div block for inline editing And when we click the edit action, we want to be able to edit it in a textarea. Welcome to http://www.test.com! Hope you enjoy it! Obviously, if we use innerHTML (or jQuery’s .html()), the textarea would show: Welcome to <a target="_blank" href="http://www.test.com">http://www.test.com</a>! <br><br>Hope you enjoy it! inline editing that incorrectly shows HTML code I do not want HTML tags! What [ ... ]

Box.net

I’ve finally made my move from San Francisco/ Berkeley to the heart of Silicon Valley! I am joining Box.net as a software engineer. I am fascinated by the ideas of this company, and the technology behind. They are totally awesome. I can’t say much yet as I am still pretty new to the team, but I am excited about the new adventure! Here, I don’t have to read and write 80 emails a day. No more client conference calls. No more consulting but only engineering! Good-bye Isobar/ Molecular! For those who don’t know, Isobar is the world’s [ ... ]
Category: myself  Tags: ,  Leave a Comment

jQuery Conference 2010: Key Takeaways

The past weekend is all about jQuery, JavaScript and web development. Similar to many other tech conferences, the jQuery conference at Microsoft’s campus in Mountain View allows developers to choose one of the two available sessions at a time slot. For me, making choices on weekends is often not desired, especially when I do not want to miss out anything. Here I am going to share the takeaways from half of the sessions I attended. Ads, widgets, and analytics – Steve Souders A similar talk on site performance was given earlier at JS Conf. See the recap here at Ajaxian. Steve recommended using [ ... ]

YOURLS: Your Own URL Shortener

There’s a long history of URL shortening services. I still remember the days when we had to host our websites on Geocities or Xoom. We all hated the long URLs, and so there came the redirect services by come.to, i.am, etc. After all, you wouldn’t argue that http://i.am/davidt looks a lot more elegant than http://www.geocities.com/neighborA/432499. The need for shortened URLs was largely due to the fact that badly generated URLs could not satisfy the sense of arrogance of being a webmaster. As domain registration fee became cheaper and cheaper, a lot of people rather pay ten bucks a year to own [ ... ]

Enabling cross-domain (third-party) cookies

I recently created a page that contains a tabbed container. In each tab, there is a different iframe that hosts a map from a third-party domain. The iframes need to rely on cookie to communicate so that they can pass address information. The problem is that IE 6 does not seem to have cookies enabled for those iframes. And of course, this issue does not only apply to maps, but also online ads that rely on iframes. The cause to the issue turns out to be a security restriction in IE 6. This is one of the few places where IE 6 [ ... ]

Hello world!

This is my first post on this new site. It officially replaces the last edition of Davidalism.com, which was created back in 2006 during my senior year of college. It’s also the first time ever that I use a theme/ template. I always thought designing (as in… creating comps, high-level wireframing, and coding) web sites from scratch is fun. However, as time goes by, I rather use an existing template that meets my taste so that I can spend more time on the actual content.  I spent too much time at work doing all these so I just want to have [ ... ]
Category: myself  Tags: ,  Leave a Comment