Archive

Archive for the ‘Javascript’ Category

SWFObject html/javascript generator

November 22nd, 2007 View Comments

I heard about SWFObject html/javascript generator from a colleague. An useful tool for people who want to use Flash/Flex in their blog/webpage and not comfortable writing html/javascript code.

Technorati Tags: , , ,



Google Gears: ResourceStore and same-orgin policy

May 31st, 2007 View Comments

I spent some time playing with Google Gears LocalServer (ResourceStore) to cache some video files from YouTube/Google-Video on client. It seems, you can only cache (store) data from same-origin. I might be wrong, but this is what I found.
I would spend more time to find out if there is a way.



Google Gears Rocks!

May 31st, 2007 View Comments

I just installed Google Gears (Beta) and checked out some examples. I love the all the features (SQLite-DB, Cache-Server and Workerpool to manage script execuation), Google Gears surly rocks!

Some links to get started:-

Technorati tags: , , , ,


Gmail: usability/accessibility issue

April 11th, 2007 View Comments

Gmail uses mouse-down event instead of click (mouse-button-release) at many places (Compose Mail, Inbox, Chats etc) in it’s frontend. 

I face following problems because of their wrong choice of event (mouse-down instead of click):

  • I can’t select text while in list view. For example, if I want to select the sender’s name or subject, instead it opens the mail thread.

     

  • If mouse-button is pressed by mistake on any of links (Compose Mail, Inbox etc), associated action takes place and I am forced to click on browser’s back button (or equivalent) to get back to previous state (screen/view). I don’t get a chance to change my mind by releasing mouse-button outside of link area.

     

Technorati tags: ,


Comparison between different client-side-storage (cookies, shared-object etc)

February 1st, 2007 View Comments

Niall Kennedy has posted interesting article, where he compares client-side-storage of Internet Explorer, Firefox and Adobe Flash Player.
Though, the title of post talks only about AJAX, I still find it useful in general. I thought to post it, you might find it useful.
Check it out.



Yahoo! Messenger Plugin SDK

June 22nd, 2006 View Comments

When I was in Yahoo!, I heard about this new plugin architecture in Yahoo! Messenger. I was very excited because I could extend the capabilities of Yahoo! Messenger with my current skills set (ActionScript, HTML, JavaScript, C++). Now this is public, I can talk about it.
You can download the latest beta of Yahoo! Messenger and get the Yahoo! Messenger Plugin SDK (which contains a sdk documentation and one example plugin).
Justin has also blogged about it. I am sure, we would soon see some cool plugins. Yeah, I also have my own ideas which I would hopefully able to do in my free time.
Meanwhile, check out plugin-gallery for some cool plugins.



Loading JavaScript file(s) using HTTPService/URLLoader

June 20th, 2006 View Comments

In my last post, I talked about JavaScript Flex 2 component that can inject Javascript code in HTML wrapper’s context. I experimented to see, if we can load Javascript files (.js) using HTTPService (or flash.net.URLLoader) in Flex2/AS3 projects and inject it.

Example Flex 2.0 code:

<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
xmlns="com.abdulqabiz.utils.*"  width="100%" height="100%" creationComplete="onAppInit ()">
<mx:Script>
<![CDATA[
import flash.external.ExternalInterface;
import mx.events.*;
import mx.rpc.events.*;
import mx.rpc.http.HTTPService;
import com.abdulqabiz.utils.JavaScript;
private var javascript:JavaScript;
private var service:HTTPService;
private function onAppInit ():void
{
service = new HTTPService ();
service.url = "test.js";
service.useProxy = false;
service.resultFormat = "text";
service.addEventListener ("result", injectJavaScript);
service.send ();
}
private function injectJavaScript (event:ResultEvent):void
{
javascript = new JavaScript ();
javascript.source = String(event.result);
trace ("javascript injected: " + event.result);
}
private function invokeSayHelloWorld ():void
{
ExternalInterface.call ("sayHelloWorld");
}
private function invokeSaySomething (str:String):void
{
ExternalInterface.call ("saySomething", str);
}
]]>
</mx:Script>
<mx:Button label="invoke javascript saySomething () function" click="invokeSaySomething ('Hey, how are you?')"/>
<mx:Button label="invoke javascript sayHelloWorld () function" click="invokeSayHelloWorld ()"/>
</mx:Application>

Test.js used in example:

//test.js
var myName = "Abdul Qabiz";
function saySomething (str)
{
alert (str);
}
function sayHelloWorld ()
{
alert ("Hello World!");
}

You would need JavaScript.as (with proper package directory structure) and test.js (code posted above) in place to make above example to work.
I am thinking to load FABridge using this approach. I know, it’s practically of no use except keeping code and logic at one place.



JavaScript injection through ActionScript

June 16th, 2006 View Comments

In last post, I showed, how can we inject JavaScript using ActionScript or MXML into host HTML container/page.

One more use-cases, I can think of:

  • Request server-side script to send a JavaScript (for specific browser) as string.  Using JavaScript class, I can inject the javascript in HTML


Philip on Progressive Enhancement

February 22nd, 2006 View Comments

If you are AJAX, Javascript or Web Developer, you should look at the posts of Philip. Quite interesting stuff.