I have just posted MajaxTwilio to GitHub. It’s essentially just a wrapper around php-twilio providing a little more structure and auto-completion, as well as giving you a structure to build around Twilio with to make your applications testable.
Let me know what you think! It’s a work in progress, but decent chunks of the basics are running.
With no javascript, nothing but the <img> tag is displayed, and everything is happy.
With javascript, we run a system which turns it into the following (this becomes easier if we can evaluate media queries in JS, but I’m not sure if we can do that, so I’m showing an alternate way):
Which should make it happy with screen readers and other similar systems.
This approach has a few distinct advantages:
It leverages existing tools for defining when to load a particular image (media queries)
It provides a graceful fallback for no javascript support
It (hopefully) will be relatively close to whatever is selected for moving forward in a browser integrated solution, as it fits with the patterns already established.
So that’s it. That’s my master plan. What do you think?