如何使用Clojure / ClojureScript创建html嵌入小部件?

时间:2014-02-18 03:27:09

标签: clojure clojurescript

我想创建一个Web Widget。它必须访问远程clojure数据结构并显示widget参数所请求的元素。视觉风格也可以远程决定。

编辑:

Youtube有这个:

<iframe width="560" height="315" src="//www.youtube.com/embed/Z6bFyVGvg28" frameborder="0" allowfullscreen></iframe>

Google地图有:

<iframe width="425" height="350" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="https://maps.google.ca/maps?q=yahoo+corp&amp;ie=UTF8&amp;hq=&amp;hnear=&amp;ll=37.417223,-122.025112&amp;spn=0.006295,0.006295&amp;t=h&amp;iwloc=A&amp;output=embed"></iframe><br /><small><a href="https://maps.google.ca/maps?q=yahoo+corp&amp;ie=UTF8&amp;hq=&amp;hnear=&amp;ll=37.417223,-122.025112&amp;spn=0.006295,0.006295&amp;t=h&amp;iwloc=A&amp;source=embed" style="color:#0000FF;text-align:left">Agrandir le plan</a></small>

所以我怀疑远程服务器的目标特定URL句柄的iframe可以完成这项任务。

在iframe中编写窗口小部件或者只是内联页面并使其成为托管页面dom的一部分之间确实存在权衡。 http://prettyprint.me/prettyprint.me/2009/05/30/widgets-iframe-vs-inline/

1 个答案:

答案 0 :(得分:2)

这是一个非常类似的请求,它在David Nolen示范项目中实现了:

https://github.com/swannodette/om-sync

基于他的clojurescript react.js薄层称为“om”:

https://github.com/swannodette/om