[JSONP-SE] JSONP Static Emulation

JSONP, JSON with Padding, is available not only with dynamic contents from server-side CGI etc., but also with static contents, just static files.

However, such static JSONP files do NOT allow to change Padding, name of callback function.
JSON with FIXED padding is a kind of JSONP? It's just a mere JavaScript file?
callback(
    { foo: 'HOGE', bar: 'POMU' } // JSON content
);
You may need to manage a queue when you handle multiple JSONP calls.

Now, the JSONP-SE is the solution for this.
JSON-SE means JSON Static Emulation.
Change the padding, "callback" in code above, to the six lines below:
( function (data) {
    var list = document.getElementsByTagName( 'script' );
    var temp = list[list.length-1].src.match( /[\?\&]callback=([A-Za-z0-9\_\.\[\]]*)/ );
    var func = temp ? temp[1] : 'callback';
    eval( func+"(data)" );
})(
    { foo: 'HOGE', bar: 'POMU' } // JSON content
);

This is still a static file, however, you could specify any callback function name you like.
The JSON content in JSON-SE is exactly the same as it in JSON.

You could load JSONP-SE file via <script> element in <body> element.
<script type="text/javascript" src="test.js?callback=hello"></script>
The callback function "hello" would be called.
<script type="text/javascript" src="test.js"></script>
Without ?callback=... argument is not specified, the default function "callback" would be called instead.

You could generate <script> element via DOM.
    var script = document.createElement( 'script' );
    script.charset = 'utf-8';
    script.type = 'text/javascript';
    script.src = 'test.js?callback=hello';
    document.lastChild.appendChild( script );
JSONP-SE must be loaded in the bottom of the dom tree.


Such trick, fetching argument from the src attribute of the script element loaded, is used in script.aculo.us as well.


* The original post of this was written in Japanese.

[Event] Tokyo ActionScript Meetup 2008 F/ Colin Moock

When I heard that Colin Moock would come to Japan to make a talk in a seminar event sponsored by Adobe Systems Inc., it hit me that we could welcome and counter him with top ActionScript engineers in Japan!
I'd like to show him the cutting-edge ActionScript techs developed in Japan, are not introduced yet to the world in English, unfortunately.

As the result, at the day of January 16, the Tokyo ActionScript Meetup 2008 F/ Colin Moock was taken a place in Adobe Japan.
Very deep tech talks about ActionScript 2, 3 & also 4(!) were told.

Colin (left) and Ota-san.

The last of all, I asked him some of questions invited by the audiences on ahead.

I think the most of audiences including me would surprised that he could speak Japanese much fluently.
As Larry Wall could speak JavaScript as well, such great programmers would be good at speaking multiple natural languages as well as programming languages.


Tokyo ActionScript Meetup 2008 F/ Colin Moock

KEYNOTE
* Colin Moock http://moock.org/

MAIN TALKS
* yossy http://www.be-interactive.org/
* munegon http://void.heteml.jp/blog/
* id:secondlife http://d.hatena.ne.jp/secondlife/

LIGHTNING TALKS
* Muraken http://www.muraken.biz/ & tera http://www.trick7.com/blog/
* Iwasaki http://www.cosmo-int.com/
* Kobayashi http://d.hatena.ne.jp/yukoba/

QUESTIONS AND ANSWERS
* Q: Kawasaki http://www.kawa.net/ on behalf of the all audiences
* A: Colin Moock http://moock.org/


We much enjoyed the session with you.
Thank you, Colin! See you again!


* The original longer post of this was written in Japanese.

Hatsumode at the Sanno Hie Shrine

At the first business day of this year, I and my all colleagues went to the Sanno Hie Shrine for Hatsumode.
This is the most important ritual on the begging of new year, I think.
We prayed for our fine health and also our success in business.

[Event] Web 2.0 EXPO Tokyo "JavaScript Labs"

I gave a presentation on Web 2.0 EXPO Tokyo (day 1) with TAKESAKO and amachang. This talk was titled as "JavaScript Labs" and introduced the cutting-edge JavaScript technical topics and what we had interest for now.

(photo taken by TAKESAKO)

At my part of the session, I talked about JavaScript's today and its future. And also I focused into my attending to Facebook and OpenSocial.
I'm wanting to see them. FBJS is early days, and OpenSocial is still version 0.5 and full of uncertainty at this time though.
I showed tiny demo application for OpenSocial:


The room we made a talk was soon fulled with about 100 audiences.


Thank you all very much for attending our session and see you soon again!

(photo also taken by TAKESAKO)



* The original post of this was written in Japanese.

[Event] Sun Tech Days 2007 in Tokyo

I gave a presentation at the last day of the Sun Tech Days 2007 in Tokyo with Tanaka-san who won three prizes on Mash up Award 3rd.


I talked about what Media Technology Labs was challenging for.



* The original post of this was written in Japanese.

[Event] John Resig and The Future of JavaScript

John Resig now comes to Tokyo! Many Japanese JavaScript developers love him and his product of jQuery.js which is the coooolest JavaScript library in the world.


Shibuya.JS had a joined event with Mozilla Japan to talk to him about ECMAScript 4 and the future of JavaScript. He gave us the keynote speech in the event.


Amachang, one of the leading JavaScript engineers in Japan, made some high-level comebacks.


A quorum of Shibuya.JS members introduced some of awesome JavaScript applications developed in Japan.

* The following ustream movies are recorded by Piro.

Part #1 - John's keynote speech

Part #2 - Shibuya.JS's talks and Q&A

We very very enjoyed with John. Thank you and see you again!


We're together closing our eyes. |-)


* The original post of this was written in Japanese.

(updated)
See also John's post

[Event] Panel discussion about Web2.0's status and its movement

I participated a panel discussion in a seminar event sponsored by METI and some other organizations in Japan. They say October is the month for informatization.


November 1st at Softpia Japan in Ogaki city, Gifu pref.

* METI is the Ministry of Economy, Trade and Industry.



* The original post of this was written in Japanese.

[Travel] Germany, Switzerland and Czech Republic

My wife, Yumi, and I love traveling around the world.
We went to three countries at this time:
1. Germany to celebrate my friends wedding
2. Switzerland to hike looking up to the Matterhorn
3. Czech Republic to beer-up beer!


Here are some of articles written in Japanese.
Digest post with photos
Railway from Konstanz to Zermatt
Other blog posts by Yumi

gugod and Ebisu.js

Kang-min Liu, a.k.a. gugod, came to Japan. After we took a lunch at Ginza district, he taught me about his current project Ebisu.js which a library implementing "custom events" handler in JavaScript.


We both Asian people talked in English. However, it's probably true that we could make communication smoother after we start to write JavaScript language. :-)


All JavaScript engineers in the world, let me know when you come to travel to Tokyo. We will welcome you. Let's talk thoroughly about JavaScript.



* The original post of this was written in Japanese.

[Event] MA3 Participants Session

September 22th was the OneWebDay. At this day, we hosted the MA3 Participants Session in Media Technology Labs, Tokyo. About 30 teams of developers which applied thier work for the Mash up Award 3rd.


Top 5 websites ranked by authors themselves:
1. Revolver Style Search (13 votes)
2. MAsh (10 votes)
2. Tamadokoweb (10 votes)
4. CHIZTEK (9 votes)
5. Comusche (8 votes)


* The original post of this was written in Japanese.