Archive for August, 2006

AdSense with GWT?

Wednesday, August 30th, 2006

I am involved with several sites that work very well with AdSense. At this point, these are sites that are strictly HTML, with no dynamic content whatsoever (purely content). The question I have been asking myself is whether I can use GWT to possibly improve my AdSense performance.

I have seen a few questions about how one might add AdSense to AJAX or GWT websites. Is this question asked backwards? Should it really be how to add GWT to AdSense sites?

(more…)

Regular Expressions via RPC

Friday, August 25th, 2006

I have found the regular expression support in GWT (if not JavaScript in general) to be more limited than what I am used to from PHP. This is fine — it’s powerful enough for most form validation, and a nice tool to use for simple parsing. But there are times when that’s just not enough. In working on my RPC code, I had a head-slapping moment when I realized that it was just as easy to provide access to PHP functions like preg_match via RPC.

It certainly can simplify those situation where you just need to validate something significant. You can probably also get more regex power through JSNI, but I like sticking to higher level functionality. I’d no doubt program in a memory leak or some other irritating feature that would be painful to debug.

urlencode in GWT

Monday, August 14th, 2006

I was having some difficulty finding exact details about support for url encoding in javascript/GWT.  The most correct method for matching urlencode is to use encodeURIComponent.  I can’t find the exact link again, but one source said that support for encodeURIComponent was unreliable across JavaScript implementations.  Another reference compared escape, encodeURI and encodeURIComponent and their documentation suggested that it should be quite common by now.

(more…)

Upcoming RPC tutorial

Friday, August 4th, 2006

I’m working on the finishing touches of another tutorial article for PHP / GWT.  Sticking with a simple and superficial approach, it is largely an extension of the previous tutorials.  It won’t totally replace the mechanism in GWT, but since that’s not easily available to PHP developers (yet), it is useful.  Plus it makes for a simplified demonstration of how more complicated interactions might be structured.

I hope to get it written up and posted in the next couple of days.  I still need to implement some sample functions in PHP.  As of today, the code is working on the client side, but the server side doesn’t do anything interesting.