Feb 26, 2008

OpenSocial JavaScript API にチャレンジ(3)

iframe を使用した外部サーバ HTML の表示

今回は JavaScript API から離れて、アプリケーションから外部サーバの HTML を表示してみる。

usingiframe.xml

Orkut へのディプロイ方法は前回と同じ。

<?xml version="1.0" encoding="UTF-8"?>
<Module>
  <ModulePrefs title="Using iframe">
    <Require feature="opensocial-0.7"/>
  </ModulePrefs>
  <Content type="html">
    <![CDATA[
      <iframe src="http://www.in-vitro.jp/blog/entries/SNS/20080226_01/child.html"/>
    ]]>
  </Content>
</Module>

child.html

usingiframe.xml 内の iframe で指定した場所に設置する。例) http://www.in-vitro.jp/blog/entries/SNS/20080226_01/child.html

<div>
  This is child html.<br />
</div>

実行結果

[using iframe]
IFrame から外部サーバにある HTML を取得して表示することができた。

TrackBack ping me at
http://www.in-vitro.jp/blog/index.cgi/SNS/20080226_01.trackback
Post a comment

writeback message: Ready to post a comment.