ホーム
こんにちはゲストさん! ログインするにはここをクリックしてください。
(hide this)
 
ニュースアイテム (toggle comments)
現在は英語のみ。(RSS登録) あるいは (もっと見る »)
Miniskirt VS Yukata
Hector asks an important question - do you prefer girls in miniskirts or a yukata? ( もっと見る » )
Thu 07/17 12:37 コメント数 (5)
Saber Lily
This gorgeous Saber Lily Figma will come bundled with a PS2 game called Unlimited Codes thats due out this Dec... ( もっと見る » )
Thu 07/17 10:00 コメント数 (26)
Japanese Disasters
Q: What is the first thing you should worry about when there are mag 9 earthquakes, tornadoes, flash floods an... ( もっと見る » )
Thu 07/17 07:00 コメント数 (19)
Another Blood
FooBarBaz has more pics of this Another Blood figure that just came out by Max factory. Brings me to a questi... ( もっと見る » )
Thu 07/17 03:14 コメント数 (23)
Sweet Girls
Akihabara - the only place where sweet girls are waiting for you to take pics of them at the cost of zero yen.... ( もっと見る » )
Wed 07/16 17:01 コメント数 (43)
Broken Figures
Dont you just hate it when that happens? As for me, swirly hair strands form my figures snap off a lot becaus... ( もっと見る » )
Wed 07/16 14:32 コメント数 (61)
Men Wear Bras
Recording of a TV show below talking about how and why some Japanese men wear bras. Many men in their early 5... ( もっと見る » )
Wed 07/16 12:30 コメント数 (51)
English/英語  Mon 07/31 21:16 JST
記事の下のPOLL(世論調査)を作った当時はiframeを使用するやり方以外は知らなかった。現在はAJAXを勉強しPOLLをAJAXで作ってみた。
作っているときにはとても苦労した。複数のXMLHttpRequestを同時に送っているため、リスポンスがうまく帰ってこない。指定したdivにリスポンスがちゃんと入ったり入らなかったり。。。

自殺する寸前に2つのライブラリーの存在を知った。PrototypeRicoだ。この2つを使い、うまく複数のXMLHttpRequestの処理ができた。。。

function update(){
ajaxEngine.registerRequest("multiple","/UrlOfScript");
ajaxEngine.registerAjaxElement("div567");
ajaxEngine.registerAjaxElement("div563");
ajaxEngine.sendRequest("multiple","");
}
window.onload=function(){
update();
}

"ajaxEngine"はrico.jsのなかのオブジェクト。"ajaxEngine.registerAjaxElement"は複数のリスポンスがはいるとこ。"UrlOfScript"はXMLHttpRequestを処理するサーバー側のスクリプトだ。そのスクリプトの後ろに"UrlOfScript.php?poll[title]=do+you+love+gundam..."のように変数を送っている。

次はそのサーバー側のスクリプトがXMLでリスポンスを出すようにしなければなりません。。。

<? header("Content-Type: application/xml"); ?>
<ajax-response>
<response type="element" id="div567">
<![CDATA[Returned HTML goes here
]]>
</response>
<response type="element" id="div563">
<![CDATA[Returned HTML goes here
]]>
</response>
</ajax-response>

このようにCDATAを使うとHTMLをそのまま放り込んでもいい。PHPを使いの方はob_start()、ob_get_contents()とob_end_clean()は役に立つと思う。

MACのFirefoxとSafari、WINのFirefoxとIE6でテストしました。多分問題ないと思いますがあれば教えてください。

ところで画像のほうはこの記事と全く関係ない。かわいいと思っただけで一緒に投稿した。efは今年発売する予定だ。
アンケートに投票して「GO!」をクリックしてください!
Edward in Michigan
Hmm...

Man, I still have a lot to learn.

Study study study...
(ID #38412) Posted on 2007/01/02 01:23
Leo in San francisco
Seems to work fine in Opera on Linux. I've been playing around with the librabries from script.aculo.us
(ID #38415) Posted on 2007/01/02 01:23
luke in virginia
thank god i've got a web development course this semester; it'll be a good refresher on javascript and a really good refresher on php
(ID #38416) Posted on 2007/01/02 01:23
Phenie in South Africa
Well... I liked the picture on the top....

The rest... well... I liked the picture ALOT!

:P
(ID #38417) Posted on 2007/01/02 01:23
[ Ash ] in Singapore
I'd definitely like to learn to Code. The Picture above I like definitely.
(ID #38419) Posted on 2007/01/02 01:23
Arekusu in The lost woods
Hmm, currently i don't know how to code, but when my bro gets back from his hols, hes gonna teach me the basics, and im gonna be making my own flashy website XD
(ID #38420) Posted on 2007/01/02 01:23
Kazuki in the land of 'Oz'
Hey man, I just discovered this site of yours (with those hilariously wholesome Trooper series of pics) and have to say, keep up the awesome work.  That Strike PG kit looks awesome btw.   

Since you're in Tokyo, were you out to see the fireworks in Sumida-ku the other day?
(ID #38423) Posted on 2007/01/02 01:23
Danny Choo in Tokyo
Didnt manage to go to the sumida fireworks as I was still down with a cold. Not sure I would have enjoyed it without getting those special seats as it does get very crowded at these venues.
(ID #38426) Posted on 2007/01/02 01:23
nodle in America
Nice picture at the top Danny!
(ID #38427) Posted on 2007/01/02 01:23
Lately, I'm a Perl coder more than anything else. I should start playibg around with AJAX....
(ID #38428) Posted on 2007/01/02 01:23
ninjascience in I'll never go back to Geo...
one commentor mentioned script.aculo.us , which also uses prototype.  I love it.

new Ajax.Updater('someDivId', 'index.php?do=getsomething');

it's that easy to return some html via Ajax and insert it into some container.  Also, be sure to check out the prototype docs at http://script.aculo.us.  There's a ton of life saving functions in there, like $(someDivId) instead of document.getElementById(someDivId)
(ID #38432) Posted on 2007/01/02 01:23
Arekusu in The lost woods
Well, with a picture like that, its a sure fire way to attract someones attention to this topic :P
(ID #38436) Posted on 2007/01/02 01:23
Gordon Pekeur in south africa -cape town-
pretty clueless when it comes to code, but I like the pic at the top!! some of my friends do a bit of coding.....I usually occupy myself with anime while they do their thing........
(ID #40748) Posted on 2007/01/02 01:23
Jon in Boston
I've got your multiple requests working, thanks. But one request is   [code][code] and I just can't get it to work in it's entirety.  Seems the XML isn't writing the proper structure. I'm using php so I tried with ob_start but just can't get it right. Any chance you'd take a look and help out?
P.S. Risa Shimamoto is fantastic.
(ID #42381) Posted on 2007/01/02 01:23
Jon
Okay, so is there a way to post code here?
(ID #42383) Posted on 2007/01/02 01:23
splog bite missionary
the whole ASYNCHRONUOUS aspect of AJAX is completely overblown.

AJAX uses this function:
xmlhttp.open(mentod,url,true);

Just make the call synchronuously:

xhtml.open(method,url,false);

DONE! No fancy libraries needed. Call your stuff multiple imes and all is well. Yes it isnt a-synchronuous, but really, do you care? unless you're loading huge amounts of code...
Edward in Michigan
Hmm...

Man, I still have a lot to learn.

Study study study...
(ID #80416) Posted on 1999/11/30 14:12
Leo in San francisco
Seems to work fine in Opera on Linux. I've been playing around with the librabries from script.aculo.us
(ID #80419) Posted on 1999/11/30 14:12
luke in virginia
thank god i've got a web development course this semester; it'll be a good refresher on javascript and a really good refresher on php
(ID #80420) Posted on 1999/11/30 14:12
Phenie in South Africa
Well... I liked the picture on the top....

The rest... well... I liked the picture ALOT!

:P
(ID #80421) Posted on 1999/11/30 14:12
[ Ash ] in Singapore
I'd definitely like to learn to Code. The Picture above I like definitely.
(ID #80423) Posted on 1999/11/30 14:12
Arekusu in The lost woods
Hmm, currently i don't know how to code, but when my bro gets back from his hols, hes gonna teach me the basics, and im gonna be making my own flashy website XD
(ID #80424) Posted on 1999/11/30 14:12
Kazuki in the land of 'Oz'
Hey man, I just discovered this site of yours (with those hilariously wholesome Trooper series of pics) and have to say, keep up the awesome work.  That Strike PG kit looks awesome btw.   

Since you're in Tokyo, were you out to see the fireworks in Sumida-ku the other day?
(ID #80427) Posted on 1999/11/30 14:12
Danny Choo in Tokyo
Didnt manage to go to the sumida fireworks as I was still down with a cold. Not sure I would have enjoyed it without getting those special seats as it does get very crowded at these venues.
(ID #80430) Posted on 1999/11/30 14:12
nodle in America
Nice picture at the top Danny!
(ID #80431) Posted on 1999/11/30 14:12
Lately, I'm a Perl coder more than anything else. I should start playibg around with AJAX....
(ID #80432) Posted on 1999/11/30 14:12
ninjascience in I'll never go back to Geo...
one commentor mentioned script.aculo.us , which also uses prototype.  I love it.

new Ajax.Updater('someDivId', 'index.php?do=getsomething');

it's that easy to return some html via Ajax and insert it into some container.  Also, be sure to check out the prototype docs at http://script.aculo.us.  There's a ton of life saving functions in there, like $(someDivId) instead of document.getElementById(someDivId)
(ID #80436) Posted on 1999/11/30 14:12
Arekusu in The lost woods
Well, with a picture like that, its a sure fire way to attract someones attention to this topic :P
(ID #80440) Posted on 1999/11/30 14:12
Gordon Pekeur in south africa -cape town-
pretty clueless when it comes to code, but I like the pic at the top!! some of my friends do a bit of coding.....I usually occupy myself with anime while they do their thing........
(ID #82752) Posted on 1999/11/30 14:12
Jon in Boston
I've got your multiple requests working, thanks. But one request is   [code][code] and I just can't get it to work in it's entirety.  Seems the XML isn't writing the proper structure. I'm using php so I tried with ob_start but just can't get it right. Any chance you'd take a look and help out?
P.S. Risa Shimamoto is fantastic.
(ID #84385) Posted on 1999/11/30 14:12
Jon
Okay, so is there a way to post code here?
(ID #84387) Posted on 1999/11/30 14:12
以前の記事
ページランク と リダイレクト
コメント数(6)
PHPとマック
コメント数(5)
今現在読まれている記事
字幕付きアニメ
コメント数(136)
ペトラ フィギュア
コメント数(31)
痛車
コメント数(55)
2次元 対 3次元
コメント数(51)
東京 自転車
コメント数(61)
もえたん
コメント数(84)
健康診断
コメント数(74)
メリッサ・セラフィ
コメント数(34)
外人とペット不可
コメント数(66)
ドラゴノーツ
コメント数(42)
終電
コメント数(32)
秋月凪
コメント数(36)
dannychoo.com ( Creative Commons ) ( ダニー・チュー ) ( アニメ、ガンダム、フィギュア ) Since 2000
アニメ
魔法にかけられて 2-Disc・スペシャ...
1位.魔法にかけられて 2-Disc・スペシャ...
2008/07/18 14:12
¥ 2,500
アニメ主題歌
「ペルソナ4」オリジナル・サウンドトラッ...
1位.「ペルソナ4」オリジナル・サウンドトラッ...
2008/07/23 14:12
¥ 3,045
アルター
ゼノサーガIII ツァラトゥストラはかく...
1位.ゼノサーガIII ツァラトゥストラはかく...
2007/12/23 14:12
¥ 6,203