Archive for the 'Yahoo!' Category


Bookmarklet For YUI Logger 4

During development using javascript I have always felt that it would be useful to be able to easily add and remove YUI Logger without having to deal with manually adding and removing the related javascript and css from the source files.

I resolved this problem by writing a bookmarklet which will allow you to do that easily. The details are available here. This has been tested on firefox 2.x, safari 3.1 and IE 6/7. Please post any bugs that you find. If you do the view source of the file you can see the code as well.

Protecting images 1

Shows how transparent image on top of another image can make the image underneath inaccessibleThis is a common problem I have had to deal with in the recent weeks, clients from projects that I have worked in the past have asked me to help them protect the images that they have on their websites and even after explaining them that once their images/content are on the internet the only thing that is possible is that we can make it harder for people to steal their content but we cant stop them from doing that. Another related project which I recently faced during the devlopment of http://gallery.search.yahoo.com was that the monkey preview was actually an iframe which contained actual links and for obvious reasons we didnt want people clicking on the links inside the iframe.

The solution that was applied to solve both the problem was a fairly straight forward one, the idea was to stretch a 1px transparent gif/png over the image or the iframe I didnt want people to right click on and even if they tried to do that, they would only be able to save the 1px gif instead of the actual image below it. As for the iframe, since it would be below the image, the links will not be click able. I had initially seen this being used on flickr and thought it was quite cool, though it might mess upsemantic markup a bit. The alt tag for this extra bit of image should not be empty here I suppose as its suppose to relay the same kind of information as the image/iframe it trying to mask however the contents of the alt tag should not be repeated.

Testing progressive enhancement in IE6/7 0

Quite often we need to do development in firefox and check in IE6/7 to ensure that the content is still available for users with or without javascript, recently i was faced with a problem which required a clever use of <noscript> tag, thanks to Neil. Will talk more about it in a later post, this one is about how to configure your IE (esp if you are only using it to check if your stuff works and not for active development) so that you can choose to allow javascript everytime you reload the page, this allows you to quickly look at both the scenarios without having to go through the entire process of enabling and disabling stuff.

1. From the Tools menu, select Internet Options.
2. Select the Security tab.
3. Click the Custom Level button.
4. Scroll to the Scripting section.
5. Under Active Scripting, select the Prompt option (usually i would select enable/disable which took time)
6. Click OK.
7. Click the Yes button.
8. Click OK.On your toolbar, click the Refresh button.

So now every time you reload your page, you get the following prompt

prompt.jpg
and you can choose to allow or disallow javascript.