Posts Tagged ‘jQuery’
AddThis.com From E-Mail

Last week, I had a client ask me how to implement sharing from an email. On the face of it, sharing isn’t that hard for any specific service. Facebook has their way. Twitter has its way. But we’ve been using the AddThis.com service. Wouldn’t it be nice if you could provide a way to implement sharing from within an email for any service AddThis.com provided? And what if you could also add the “Share” button so that even if you didn’t put the service in the email that they wanted to use, they still were able to share using the share button?
Well, it took a while, but I finally figured it all out.
jQuery and ASP.NET UpdatePanel
I’ve been busy over the last couple of weeks working on an administrative application that uses a ton of AJAXy stuff.
The application is interactive in the sense that every time a field is updated in the administrative screen, another part of the screen updates to show the user what the final result will look like when it is published.
Where things get tricky is that the screens use a considerable amount of jQuery to do things like binding to events so that updates will occur when the events fire.
But the main content that is being updated for one of my screens is actually in an UpdatePanel. This is a problem, because in order for that screen to render correctly I have to run some jQuery code. But the jQuery “ready” event doesn’t fire when the UpdatePanel gets updated.
So how do we fix that?
jQuery, Each() and Async Gets
One of the things to keep in mind when using jQuery is that nothing is a blocking call. Sure, there is a certain sequence to when things operate. But, to be safe, you should always assume that step two will happen during step one.
Nowhere is this more evident than when retrieving content from a URL and inserting that content in your page.
JQuery, Cufon, and Dynamic Content
Yesterday I mentioned a new tool called Cufon that allows you to easily embed fonts in your web site.
One quirk about this tool is that your HTML has to be rendered prior to applying, or refreshing, the font. If you are using any kind of AJAXy stuff in your site, you’ll need to re-apply the font change. The trick is knowing when to do this.
Flash to jQuery
I have long argued that 99% if the things people think they need to use Adobe’s Flash for could be done just as well using JavaScript.
Now that jQuery is available, I am even more convinced that this is the case.
There are, however, a few hurdles that need to be jumped to make this happen. For example, one thing Flash has been good at is embedding fonts and while you can embed fonts using CSS, the little bit of research I’ve done on the subject has demonstrated that it wouldn’t necessarily be easy.
Recently, someone took me up on the challenge, and I am actually converting a Flash script to jQuery. And it is working quite nicely, thank you very much.
Here are some tools I’ve discovered along the way.